Skip to content

RFC x86: keep TASK_SIZE in sync with mm->task_size

Dmitry Safonov linux-arm-kernel linux-mips linux-parisc linuxppc-dev lkml sparclinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mm: remove unused TASK_SIZE_OF()arch/arm64/include/asm/memory.h arch/mips/include/asm/processor.h arch/parisc/include/asm/processor.h +5 more+3 -205 replies
2/4x86/thread_info: kill TIF_ADDR32 in favour of ADDR_LIMIT_32BITarch/x86/include/asm/elf.h arch/x86/include/asm/processor.h arch/x86/include/asm/thread_info.h +2 more+11 -101 reply
3/4x86/mm: define TASK_SIZE as current->mm->task_sizearch/x86/include/asm/processor.h arch/x86/um/asm/segment.h arch/x86/xen/mmu.c +1 more+23 -170 replies
4/4x86/arch_prctl: add ARCH_{GET,SET}_TASK_SIZEarch/x86/include/uapi/asm/prctl.h arch/x86/kernel/process_64.c+16 -02 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchAndy LutomirskiHeiko CarstensKirill A. Shutemov
1/4R-b A-b A-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [RFC 0/4] x86: keep TASK_SIZE in sync with mm->task_size

At this moment, we have following task_size-related things:
- TASK_SIZE_OF() macro, which is unused;
- current->mm->task_size which is used in half and TASK_SIZE() macro which is used in the other half of code
- TIF_ADDR32, which is used to detect 32-bit address space and is x86-specific, where some other arches misused TIF_32BIT
- personality ADDR_LIMIT_32BIT, which is used on arm/alpha
- ADDR_LIMIT_3GB, which is x86-specific and can be used to change running task's TASK_SIZE 3GB <-> 4GB

This patches set removes unused definition of TASK_SIZE_OF (1), defines TASK_SIZE macro as current->mm->task_size (3). I would suggest define TASK_SIZE this way in generic version, but currently I test it only on x86.
It also frees thread info flag (2) and adds arch_prctl() on x86_64 to get/set current virtual address space size - as it's needed by now only for CRIU, hide it under CHECKPOINT_RESTORE config.
Hope those patches will help to clean task_size-related code at least a bit (and helps me to restore vaddr limits).

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc x86 at kernel.org

Dmitry Safonov (4):
mm: remove unused TASK_SIZE_OF()
x86/thread_info: kill TIF_ADDR32 in favour of ADDR_LIMIT_32BIT x86/mm: define TASK_SIZE as current->mm->task_size x86/arch_prctl: add ARCH_{GET,SET}_TASK_SIZE

 arch/arm64/include/asm/memory.h       |  2 --
 arch/mips/include/asm/processor.h     |  3 ---
 arch/parisc/include/asm/processor.h   |  3 +--
 arch/powerpc/include/asm/processor.h  |  3 +--
 arch/s390/include/asm/processor.h     |  3 +--
 arch/sparc/include/asm/processor_64.h |  3 ---
 arch/x86/include/asm/elf.h            |  7 +++++--
 arch/x86/include/asm/processor.h      | 19 +++++++++----------
 arch/x86/include/asm/thread_info.h    |  4 +---
 arch/x86/include/uapi/asm/prctl.h     |  3 +++
 arch/x86/kernel/process_64.c          | 17 +++++++++++++++--
 arch/x86/kernel/sys_x86_64.c          |  4 ++--
 arch/x86/um/asm/segment.h             |  2 +-
 arch/x86/xen/mmu.c                    |  4 ++--
 fs/exec.c                             | 17 +++++++++++------
 include/linux/sched.h                 |  4 ----
 16 files changed, 52 insertions(+), 46 deletions(-)
Signature · 1 line
2.11.0