summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-06-10 19:38:18 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-06-10 19:43:10 -0300
commitc7b830b03a976297d28598fb01c82d2e4a1d97de (patch)
treeb01f8e265b57cc8a620ed12eff12f5d2b86f168b
parent2a51b03d73f5a4b78420488e2e426abb24a4a7d9 (diff)
downloadpython-linux-procfs-c7b830b03a976297d28598fb01c82d2e4a1d97de.tar.gz
pidstat: Add PF_NO_SETAFFINITY const
For the stat flag that means that userland is not allowed to meddle with cpus_allowed, i.e. with the thread's smp affinity, via sched_setaffinity. This indeed has the same value as PF_THREAD_BOUND, see the kernel sources for an explanation, but basically was in this cset: commit 14a40ffccd6163bbcd1d6f32b28a88ffe6149fc6 Author: Tejun Heo <tj@kernel.org> Date: Tue Mar 19 13:45:20 2013 -0700 sched: replace PF_THREAD_BOUND with PF_NO_SETAFFINITY PF_THREAD_BOUND was originally used to mark kernel threads which were bound to a specific CPU using kthread_bind() and a task with the flag set allows cpus_allowed modifications only to itself. Workqueue is currently abusing it to prevent userland from meddling with cpus_allowed of workqueue workers. --------------------------------------------------------------- So add the new const but keep the old one, we may have some tool out there using it. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-xprocfs/procfs.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/procfs/procfs.py b/procfs/procfs.py
index 0dbf7f5..4ff7e98 100755
--- a/procfs/procfs.py
+++ b/procfs/procfs.py
@@ -2,7 +2,7 @@
# -*- python -*-
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2007 Red Hat, Inc.
+# Copyright (C) 2007-2015 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -54,6 +54,7 @@ class pidstat:
PF_SPREAD_PAGE = 0x01000000
PF_SPREAD_SLAB = 0x02000000
PF_THREAD_BOUND = 0x04000000
+ PF_NO_SETAFFINITY = 0x04000000 # /* Userland is not allowed to meddle with cpus_allowed */
PF_MEMPOLICY = 0x10000000
PF_MUTEX_TESTER = 0x20000000
PF_FREEZER_SKIP = 0x40000000