android_kernel_xiaomi_sm8350/include/asm-powerpc
Rafael J. Wysocki 8a102eed9c [PATCH] PM: Fix SMP races in the freezer
Currently, to tell a task that it should go to the refrigerator, we set the
PF_FREEZE flag for it and send a fake signal to it.  Unfortunately there
are two SMP-related problems with this approach.  First, a task running on
another CPU may be updating its flags while the freezer attempts to set
PF_FREEZE for it and this may leave the task's flags in an inconsistent
state.  Second, there is a potential race between freeze_process() and
refrigerator() in which freeze_process() running on one CPU is reading a
task's PF_FREEZE flag while refrigerator() running on another CPU has just
set PF_FROZEN for the same task and attempts to reset PF_FREEZE for it.  If
the refrigerator wins the race, freeze_process() will state that PF_FREEZE
hasn't been set for the task and will set it unnecessarily, so the task
will go to the refrigerator once again after it's been thawed.

To solve first of these problems we need to stop using PF_FREEZE to tell
tasks that they should go to the refrigerator.  Instead, we can introduce a
special TIF_*** flag and use it for this purpose, since it is allowed to
change the other tasks' TIF_*** flags and there are special calls for it.

To avoid the freeze_process()-refrigerator() race we can make
freeze_process() to always check the task's PF_FROZEN flag after it's read
its "freeze" flag.  We should also make sure that refrigerator() will
always reset the task's "freeze" flag after it's set PF_FROZEN for it.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: David Howells <dhowells@redhat.com>
Cc: Andi Kleen <ak@muc.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-13 09:05:49 -08:00
..
iseries [POWERPC] Refactor 64 bits DMA operations 2006-12-04 20:38:40 +11:00
8253pit.h
a.out.h
abs_addr.h
agp.h
asm-compat.h [POWERPC] Support feature fixups in vdso's 2006-10-25 11:54:07 +10:00
atomic.h
auxvec.h
backlight.h [PATCH] powermac: More powermac backlight fixes 2006-07-31 13:28:45 -07:00
bitops.h [PATCH] LOG2: Make powerpc's __ilog2_u64() take a 64-bit argument 2006-12-11 12:29:27 -08:00
bootx.h
btext.h
bug.h [POWERPC] Generic BUG for powerpc 2006-12-11 16:35:07 +11:00
bugs.h
byteorder.h
cache.h
cacheflush.h
cell-pmu.h [POWERPC] cell: Add oprofile support 2006-12-04 20:40:14 +11:00
checksum.h [NET]: POWERPC checksum annotations and cleanups. 2006-12-02 21:23:20 -08:00
compat.h
cputable.h Merge branch 'for_paulus' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc 2006-12-11 16:31:42 +11:00
cputime.h
current.h [POWERPC] Make current preempt-safe 2006-11-01 14:52:48 +11:00
dbdma.h [POWERPC] Xserve cpu-meter driver 2006-12-04 20:39:30 +11:00
dcr-mmio.h [POWERPC] Generic DCR infrastructure 2006-12-04 16:08:25 +11:00
dcr-native.h [POWERPC] Only export __mtdcr/__mfdcr if CONFIG_PPC_DCR is set 2006-12-10 23:15:47 -06:00
dcr.h [POWERPC] Only export __mtdcr/__mfdcr if CONFIG_PPC_DCR is set 2006-12-10 23:15:47 -06:00
delay.h
device.h [POWERPC] Refactor 64 bits DMA operations 2006-12-04 20:38:40 +11:00
div64.h
dma-mapping.h [PATCH] Pass struct dev pointer to dma_cache_sync() 2006-12-07 08:39:41 -08:00
dma.h
eeh_event.h
eeh.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
elf.h [PATCH] elf: Always define elf_addr_t in linux/elf.h 2006-12-07 08:39:38 -08:00
emergency-restart.h
errno.h
fcntl.h
firmware.h [POWERPC] ps3: multiplatform build fixes 2006-12-04 20:41:16 +11:00
floppy.h
fs_pd.h POWERPC: Get rid of remapping the whole immr 2006-09-21 22:37:58 +04:00
futex.h [PATCH] mm: pagefault_{disable,enable}() 2006-12-07 08:39:21 -08:00
grackle.h
hardirq.h
heathrow.h
hvcall.h [POWERPC] powerpc: Instrument Hypervisor Calls 2006-09-13 18:39:53 +10:00
hvconsole.h
hvcserver.h
hw_irq.h [POWERPC] Delete unused irq functions on powerpc 2006-12-08 17:10:18 +11:00
i8259.h [POWERPC] Fix CHRP platforms with only 8259 2006-10-25 13:49:22 +10:00
ibmebus.h [POWERPC] Refactor 64 bits DMA operations 2006-12-04 20:38:40 +11:00
ide.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
immap_86xx.h
immap_qe.h [PATCH] Optimize qe_brg struct to use an array 2006-11-13 14:49:01 +11:00
io-defs.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
io.h [POWERPC] include/asm-powerpc/: "extern inline" -> "static inline" 2006-12-04 20:41:26 +11:00
ioctl.h
ioctls.h
iommu.h [POWERPC] Cell iommu support 2006-12-04 20:39:02 +11:00
ipc.h
ipcbuf.h
ipic.h [POWERPC] Fix up after irq changes 2006-10-07 22:08:26 +10:00
irq_regs.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
irq.h [POWERPC] add virq_to_hw accessor routine 2006-12-04 20:40:37 +11:00
irqflags.h
Kbuild [POWERPC] cell: Fix spu_info.h header export 2006-12-08 15:55:55 +11:00
kdebug.h
kdump.h [POWERPC] kdump: Support kernels having 64k page size. 2006-09-13 18:30:04 +10:00
kexec.h [POWERPC] Make crash.c work on 32-bit and 64-bit 2006-08-17 16:41:10 +10:00
keylargo.h
kmap_types.h
kprobes.h [PATCH] kprobes: handle symbol resolution when <module:.symbol> is specified 2006-10-02 07:57:16 -07:00
linkage.h
lmb.h
local.h
lppaca.h [POWERPC] Update lppaca offset comments 2006-08-08 17:08:58 +10:00
lv1call.h [POWERPC] ps3: add lv1 hvcalls 2006-12-04 20:40:44 +11:00
machdep.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
macio.h
mc146818rtc.h
mediabay.h
mman.h
mmu_context.h
mmu.h [POWERPC] Make pSeries_lpar_hpte_insert static 2006-10-16 16:33:04 +10:00
mmzone.h
module.h [POWERPC] Generic BUG for powerpc 2006-12-11 16:35:07 +11:00
mpc52xx.h [POWERPC] Add common routines for 52xx support in arch/powerpc 2006-12-04 20:41:42 +11:00
mpc85xx.h [PATCH] ppc: Fix io.h for config with CONFIG_PCI not set 2006-11-13 14:49:25 +11:00
mpc86xx.h [POWERPC] Use mpc8641hpcn PIC base address from dev tree. 2006-08-25 14:32:13 +10:00
mpic.h [POWERPC] Improve MPIC driver auto-configuration from DT 2006-12-04 16:08:41 +11:00
msgbuf.h
mutex.h
namei.h
nvram.h
of_device.h [POWERPC] Refactor 64 bits DMA operations 2006-12-04 20:38:40 +11:00
of_platform.h [POWERPC] Souped-up of_platform_device support 2006-12-04 16:08:52 +11:00
ohare.h
oprofile_impl.h [POWERPC] cell: Add oprofile support 2006-12-04 20:40:14 +11:00
paca.h [POWERPC] Lazy interrupt disabling for 64-bit machines 2006-10-16 16:31:36 +10:00
page_32.h [PATCH] LOG2: Provide ilog2() fallbacks for powerpc 2006-12-08 08:28:51 -08:00
page_64.h
page.h [POWERPC] Remove DISCONTIGMEM cruft from page.h 2006-09-22 15:19:58 +10:00
param.h
parport.h
pci-bridge.h [POWERPC] Fix mmap of PCI resource with hack for X 2006-12-08 17:21:06 +11:00
pci.h [POWERPC] Define pci_unmap_addr() et al. when CONFIG_NOT_COHERENT_CACHE=y 2006-12-08 17:10:18 +11:00
percpu.h
pgalloc.h [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
pgtable-4k.h [PATCH] Standardize pxx_page macros 2006-09-26 08:48:51 -07:00
pgtable-64k.h
pgtable.h [PATCH] Standardize pxx_page macros 2006-09-26 08:48:51 -07:00
pmac_feature.h
pmac_low_i2c.h
pmac_pfunc.h
pmc.h [POWERPC] Fix oprofile support for e500 in arch/powerpc 2006-11-01 14:52:48 +11:00
poll.h
posix_types.h
ppc_asm.h [POWERPC] Cell timebase bug workaround 2006-10-25 11:54:18 +10:00
ppc-pci.h [POWERPC] Generic OF platform driver for PCI host bridges. 2006-12-04 20:38:49 +11:00
processor.h [PATCH] Remove _machine macro 2006-11-13 14:44:58 +11:00
prom.h Merge branch 'linux-2.6' into for-linus 2006-12-04 15:59:07 +11:00
ps3.h [POWERPC] ps3: add ps3 platform system bus support 2006-12-04 20:40:57 +11:00
pSeries_reconfig.h
ptrace.h [PATCH] Add regs_return_value() helper 2006-10-02 07:57:16 -07:00
qe_ic.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
qe.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
reg_8xx.h
reg.h [POWERPC] Add SPURR SPR to sysfs 2006-12-09 11:39:06 +11:00
resource.h
rtas.h [POWERPC] Add rtas_service_present() helper 2006-12-08 17:10:22 +11:00
rtc.h
rwsem.h
scatterlist.h
seccomp.h
sections.h
semaphore.h
sembuf.h
serial.h
setup.h [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
smu.h [POWERPC] powermac: Constify & voidify get_property() 2006-07-31 15:55:05 +10:00
socket.h
sockios.h
sparsemem.h [POWERPC] ps3: add lpar addressing 2006-12-04 20:40:52 +11:00
spinlock_types.h
spinlock.h [PATCH] Directed yield: direct yield of spinlocks for powerpc 2006-10-01 00:39:22 -07:00
spu_csa.h [POWERPC] spufs: wrap mfc sdr access 2006-10-25 14:20:20 +10:00
spu_info.h [POWERPC] spufs: Add /lslr, /dma_info and /proxydma files 2006-12-04 20:39:45 +11:00
spu_priv1.h [POWERPC] cell: abstract spu management routines 2006-12-04 20:40:39 +11:00
spu.h [POWERPC] cell: abstract spu management routines 2006-12-04 20:40:39 +11:00
sstep.h
stat.h
statfs.h
string.h
synch.h
syscalls.h
systbl.h [POWERPC] Wire up sys_move_pages 2006-11-16 10:31:14 +11:00
system.h [POWERPC] Fix rmb() for e500-based machines it 2006-11-01 14:52:48 +11:00
tce.h [POWERPC] Use 4kB iommu pages even on 64kB-page systems 2006-11-01 14:52:48 +11:00
termbits.h [PATCH] tty: switch to ktermios 2006-12-08 08:28:57 -08:00
termios.h
thread_info.h [PATCH] PM: Fix SMP races in the freezer 2006-12-13 09:05:49 -08:00
time.h [POWERPC] Revert "[POWERPC] Add powerpc get/set_rtc_time interface to new generic rtc class" 2006-11-22 12:13:36 +11:00
timex.h [POWERPC] Cell timebase bug workaround 2006-10-25 11:54:18 +10:00
tlb.h
tlbflush.h
topology.h [PATCH] sched: add option to serialize load balancing 2006-12-10 09:55:43 -08:00
tsi108_irq.h [POWERPC] Update mpc7448hpc2 board irq support using device tree 2006-08-23 15:51:18 +10:00
tsi108.h [POWERPC] include/asm-powerpc/: "extern inline" -> "static inline" 2006-12-04 20:41:26 +11:00
types.h [PATCH] Centralise definitions of sector_t and blkcnt_t 2006-12-04 19:41:15 -08:00
uaccess.h [POWERPC] include/asm-powerpc/: "extern inline" -> "static inline" 2006-12-04 20:41:26 +11:00
ucc_fast.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
ucc_slow.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
ucc.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
ucontext.h
udbg.h
unaligned.h
uninorth.h
unistd.h [PATCH] remove kernel syscalls 2006-12-07 08:39:37 -08:00
user.h
vdso_datapage.h
vdso.h
vga.h
vio.h [POWERPC] Refactor 64 bits DMA operations 2006-12-04 20:38:40 +11:00
xmon.h [POWERPC] add support for stopping spus from xmon 2006-10-25 14:20:22 +10:00
xor.h