aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ucs2_string.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 11:42:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 11:42:45 -0400
commit5a5a1bf099d6942399ea0b34a62e5f0bc4c5c36e (patch)
treedf094aa1544281ec0894eee48ad60c9d000a18ba /lib/ucs2_string.c
parent74c7d2f5200a340ae6655e9adcf990381e387937 (diff)
parent5379f8c0d72cab43bbe6d974ceb3ad84dddc2b8e (diff)
Merge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 RAS changes from Ingo Molnar: - Add an Intel CMCI hotplug fix - Add AMD family 16h EDAC support - Make the AMD MCE banks code more flexible for virtual environments * 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: amd64_edac: Add Family 16h support x86/mce: Rework cmci_rediscover() to play well with CPU hotplug x86, MCE, AMD: Use MCG_CAP MSR to find out number of banks on AMD x86, MCE, AMD: Replace shared_bank array with is_shared_bank() helper
Diffstat (limited to 'lib/ucs2_string.c')
0 files changed, 0 insertions, 0 deletions
n class="hl kwb">bool should_send_signal(struct task_struct *p) { return !(p->flags & PF_FREEZER_NOSIG); } /* Takes and releases task alloc lock using task_lock() */ extern int thaw_process(struct task_struct *p); extern void refrigerator(void); extern int freeze_processes(void); extern void thaw_processes(void); static inline int try_to_freeze(void) { if (freezing(current)) { refrigerator(); return 1; } else return 0; } extern bool freeze_task(struct task_struct *p, bool sig_only); extern void cancel_freezing(struct task_struct *p); #ifdef CONFIG_CGROUP_FREEZER extern int cgroup_freezing_or_frozen(struct task_struct *task); #else /* !CONFIG_CGROUP_FREEZER */ static inline int cgroup_freezing_or_frozen(struct task_struct *task) { return 0; } #endif /* !CONFIG_CGROUP_FREEZER */ /* * The PF_FREEZER_SKIP flag should be set by a vfork parent right before it * calls wait_for_completion(&vfork) and reset right after it returns from this * function. Next, the parent should call try_to_freeze() to freeze itself * appropriately in case the child has exited before the freezing of tasks is * complete. However, we don't want kernel threads to be frozen in unexpected * places, so we allow them to block freeze_processes() instead or to set * PF_NOFREEZE if needed and PF_FREEZER_SKIP is only set for userland vfork * parents. Fortunately, in the ____call_usermodehelper() case the parent won't * really block freeze_processes(), since ____call_usermodehelper() (the child) * does a little before exec/exit and it can't be frozen before waking up the * parent. */ /* * If the current task is a user space one, tell the freezer not to count it as * freezable. */ static inline void freezer_do_not_count(void) { if (current->mm) current->flags |= PF_FREEZER_SKIP; } /* * If the current task is a user space one, tell the freezer to count it as * freezable again and try to freeze it. */ static inline void freezer_count(void) { if (current->mm) { current->flags &= ~PF_FREEZER_SKIP; try_to_freeze(); } } /* * Check if the task should be counted as freezeable by the freezer */ static inline int freezer_should_skip(struct task_struct *p) { return !!(p->flags & PF_FREEZER_SKIP); } /* * Tell the freezer that the current task should be frozen by it */ static inline void set_freezable(void) { current->flags &= ~PF_NOFREEZE; } /* * Tell the freezer that the current task should be frozen by it and that it * should send a fake signal to the task to freeze it. */ static inline void set_freezable_with_signal(void) { current->flags &= ~(PF_NOFREEZE | PF_FREEZER_NOSIG); } /* * Freezer-friendly wrappers around wait_event_interruptible() and * wait_event_interruptible_timeout(), originally defined in <linux/wait.h> */ #define wait_event_freezable(wq, condition) \ ({ \ int __retval; \ do { \ __retval = wait_event_interruptible(wq, \ (condition) || freezing(current)); \ if (__retval && !freezing(current)) \ break; \ else if (!(condition)) \ __retval = -ERESTARTSYS; \ } while (try_to_freeze()); \ __retval; \ }) #define wait_event_freezable_timeout(wq, condition, timeout) \ ({ \ long __retval = timeout; \ do { \ __retval = wait_event_interruptible_timeout(wq, \ (condition) || freezing(current), \ __retval); \ } while (try_to_freeze()); \ __retval; \ }) #else /* !CONFIG_FREEZER */