android_kernel_oneplus_msm8998/arch
Linus Torvalds 50d3f7d55a UPSTREAM: Clarify naming of thread info/stack allocators
We've had the thread info allocated together with the thread stack for
most architectures for a long time (since the thread_info was split off
from the task struct), but that is about to change.

But the patches that move the thread info to be off-stack (and a part of
the task struct instead) made it clear how confused the allocator and
freeing functions are.

Because the common case was that we share an allocation with the thread
stack and the thread_info, the two pointers were identical.  That
identity then meant that we would have things like

	ti = alloc_thread_info_node(tsk, node);
	...
	tsk->stack = ti;

which certainly _worked_ (since stack and thread_info have the same
value), but is rather confusing: why are we assigning a thread_info to
the stack? And if we move the thread_info away, the "confusing" code
just gets to be entirely bogus.

So remove all this confusion, and make it clear that we are doing the
stack allocation by renaming and clarifying the function names to be
about the stack.  The fact that the thread_info then shares the
allocation is an implementation detail, and not really about the
allocation itself.

This is a pure renaming and type fix: we pass in the same pointer, it's
just that we clarify what the pointer means.

The ia64 code that actually only has one single allocation (for all of
task_struct, thread_info and kernel thread stack) now looks a bit odd,
but since "tsk->stack" is actually not even used there, that oddity
doesn't matter.  It would be a separate thing to clean that up, I
intentionally left the ia64 changes as a pure brute-force renaming and
type change.

Acked-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Bug: 38331309
Change-Id: I870b5476fc900c9145134f9dd3ed18a32a490162
(cherry picked from commit b235beea9e996a4d36fed6cfef4801a3e7d7a9a5)
Signed-off-by: Zubin Mithra <zsm@google.com>
2017-08-09 15:23:22 +01:00
..
alpha osf_wait4(): fix infoleak 2017-05-25 14:30:17 +02:00
arc mm: larger stack guard gap, between vmas 2017-06-26 07:13:11 +02:00
arm This is the 4.4.80 stable release 2017-08-07 14:29:16 -07:00
arm64 This is the 4.4.80 stable release 2017-08-07 14:29:16 -07:00
avr32 avr32: off by one in at32_init_pio() 2016-10-07 15:23:45 +02:00
blackfin net: smc91x: fix SMC accesses 2016-09-30 10:18:37 +02:00
c6x Merge 4.4.59 into android-4.4 2017-04-06 19:01:38 +00:00
cris cris: Only build flash rescue image if CONFIG_ETRAX_AXISFLASHMAP is selected 2017-01-12 11:22:48 +01:00
frv mm: larger stack guard gap, between vmas 2017-06-26 07:13:11 +02:00
h8300 Merge 4.4.59 into android-4.4 2017-04-06 19:01:38 +00:00
hexagon hexagon: fix strncpy_from_user() error return 2016-09-24 10:07:44 +02:00
ia64 UPSTREAM: Clarify naming of thread info/stack allocators 2017-08-09 15:23:22 +01:00
m32r m32r: fix __get_user() 2016-09-24 10:07:43 +02:00
m68k m68k: Fix ndelay() macro 2016-12-15 08:49:23 -08:00
metag metag/uaccess: Check access_ok in strncpy_from_user 2017-05-25 14:30:16 +02:00
microblaze microblaze: fix copy_from_user() 2016-09-24 10:07:43 +02:00
mips This is the 4.4.79 stable release 2017-07-27 15:36:54 -07:00
mn10300 UPSTREAM: Clarify naming of thread info/stack allocators 2017-08-09 15:23:22 +01:00
nios2 nios2: reserve boot memory for device tree 2017-04-12 12:38:34 +02:00
openrisc openrisc: Add _text symbol to fix ksym build error 2017-08-06 19:19:45 -07:00
parisc This is the 4.4.78 stable release 2017-07-21 09:14:57 +02:00
powerpc This is the 4.4.80 stable release 2017-08-07 14:29:16 -07:00
s390 s390/syscalls: Fix out of bounds arguments access 2017-07-27 15:06:06 -07:00
score score: fix copy_from_user() and friends 2016-09-24 10:07:44 +02:00
sh mm: larger stack guard gap, between vmas 2017-06-26 07:13:11 +02:00
sparc This is the 4.4.74 stable release 2017-06-27 09:47:59 +02:00
tile UPSTREAM: Clarify naming of thread info/stack allocators 2017-08-09 15:23:22 +01:00
um um: Don't discard .text.exit section 2016-09-07 08:32:38 +02:00
unicore32 pwm: Changes for v4.4-rc1 2015-11-11 09:16:10 -08:00
x86 This is the 4.4.80 stable release 2017-08-07 14:29:16 -07:00
xtensa mm: larger stack guard gap, between vmas 2017-06-26 07:13:11 +02:00
.gitignore
Kconfig UPSTREAM: Clarify naming of thread info/stack allocators 2017-08-09 15:23:22 +01:00