1
0
Fork 0
alistair23-linux/include
Lee Schermerhorn aab0b1029f mempolicy: mark shared policies for unref
As part of yet another rework of mempolicy reference counting, we want to be
able to identify shared policies efficiently, because they have an extra ref
taken on lookup that needs to be removed when we're finished using the policy.

  Note:  the extra ref is required because the policies are
  shared between tasks/processes and can be changed/freed
  by one task while another task is using them--e.g., for
  page allocation.

Building on David Rientjes mempolicy "mode flags" enhancement, this patch
indicates a "shared" policy by setting a new MPOL_F_SHARED flag in the flags
member of the struct mempolicy added by David.  MPOL_F_SHARED, and any future
"internal mode flags" are reserved from bit zero up, as they will never be
passed in the upper bits of the mode argument of a mempolicy API.

I set the MPOL_F_SHARED flag when the policy is installed in the shared policy
rb-tree.  Don't need/want to clear the flag when removing from the tree as the
mempolicy is freed [unref'd] internally to the sp_delete() function.  However,
a task could hold another reference on this mempolicy from a prior lookup.  We
need the MPOL_F_SHARED flag to stay put so that any tasks holding a ref will
unref, eventually freeing, the mempolicy.

A later patch in this series will introduce a function to conditionally unref
[mpol_free] a policy.  The MPOL_F_SHARED flag is one reason [currently the
only reason] to unref/free a policy via the conditional free.

Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-28 08:58:24 -07:00
..
acpi ACPI, cpuidle: Clarify C-state description in sysfs 2008-02-14 00:09:55 -05:00
asm-alpha mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-arm mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-avr32 mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-blackfin [Blackfin] arch: add include/boot .gitignore files 2008-04-25 08:29:11 +08:00
asm-cris mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-frv mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-generic bitops: use __fls for fls64 on 64-bit archs 2008-04-26 19:21:16 +02:00
asm-h8300 Generic semaphore implementation 2008-04-17 10:42:34 -04:00
asm-ia64 mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-m32r mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-m68k mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-m68knommu Generic semaphore implementation 2008-04-17 10:42:34 -04:00
asm-mips mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-mn10300 mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-parisc mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-powerpc mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-ppc mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-s390 s390: implement pte special bit 2008-04-28 08:58:23 -07:00
asm-sh mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-sparc mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-sparc64 mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-um mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-v850 Generic semaphore implementation 2008-04-17 10:42:34 -04:00
asm-x86 mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
asm-xtensa mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
crypto [CRYPTO] aes: Export generic setkey 2008-04-21 10:19:34 +08:00
keys KEYS: Fix the comment to match the file name in rxrpc-type.h. 2008-04-21 22:43:55 +00:00
linux mempolicy: mark shared policies for unref 2008-04-28 08:58:24 -07:00
math-emu
media V4L/DVB (7677): saa7134: Add/fix Beholder entries 2008-04-24 14:09:46 -03:00
mtd UBI: make ubi-header.h local 2008-04-17 11:31:58 +03:00
net IPv6 support for NFS server export caches 2008-04-23 16:13:36 -04:00
pcmcia
rdma IB: convert struct class_device to struct device 2008-04-19 19:10:30 -07:00
rxrpc
scsi [SCSI] rework scsi_target allocation 2008-04-22 15:16:31 -05:00
sound [ALSA] Define MPU401 registers in sound/mpu401_uart.h 2008-04-24 12:38:22 +02:00
video
xen xen: add balloon driver 2008-04-24 23:57:33 +02:00
Kbuild