|
|
c682bc |
From 905f778dc295ad5d934fed6fd5f2742c2123dbcd Mon Sep 17 00:00:00 2001
|
|
|
c682bc |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
|
c682bc |
Date: Wed, 10 Jun 2015 19:38:18 -0300
|
|
|
c682bc |
Subject: [PATCH 2/7] pidstat: Add PF_NO_SETAFFINITY const
|
|
|
c682bc |
|
|
|
c682bc |
For the stat flag that means that userland is not allowed to meddle with
|
|
|
c682bc |
cpus_allowed, i.e. with the thread's smp affinity, via
|
|
|
c682bc |
sched_setaffinity.
|
|
|
c682bc |
|
|
|
c682bc |
This indeed has the same value as PF_THREAD_BOUND, see the kernel
|
|
|
c682bc |
sources for an explanation, but basically was in this cset:
|
|
|
c682bc |
|
|
|
c682bc |
commit 14a40ffccd6163bbcd1d6f32b28a88ffe6149fc6
|
|
|
c682bc |
Author: Tejun Heo <tj@kernel.org>
|
|
|
c682bc |
Date: Tue Mar 19 13:45:20 2013 -0700
|
|
|
c682bc |
|
|
|
c682bc |
sched: replace PF_THREAD_BOUND with PF_NO_SETAFFINITY
|
|
|
c682bc |
|
|
|
c682bc |
PF_THREAD_BOUND was originally used to mark kernel threads which
|
|
|
c682bc |
were bound to a specific CPU using kthread_bind() and a task with
|
|
|
c682bc |
the flag set allows cpus_allowed modifications only to itself.
|
|
|
c682bc |
Workqueue is currently abusing it to prevent userland from meddling
|
|
|
c682bc |
with cpus_allowed of workqueue workers.
|
|
|
c682bc |
|
|
|
c682bc |
---------------------------------------------------------------
|
|
|
c682bc |
|
|
|
c682bc |
So add the new const but keep the old one, we may have some tool out
|
|
|
c682bc |
there using it.
|
|
|
c682bc |
|
|
|
c682bc |
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
|
c682bc |
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
|
c682bc |
---
|
|
|
c682bc |
procfs/procfs.py | 3 ++-
|
|
|
c682bc |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
c682bc |
|
|
|
c682bc |
diff --git a/procfs/procfs.py b/procfs/procfs.py
|
|
|
c682bc |
index 0dbf7f5b7da5..4ff7e9804bc9 100755
|
|
|
c682bc |
--- a/procfs/procfs.py
|
|
|
c682bc |
+++ b/procfs/procfs.py
|
|
|
c682bc |
@@ -2,7 +2,7 @@
|
|
|
c682bc |
# -*- python -*-
|
|
|
c682bc |
# -*- coding: utf-8 -*-
|
|
|
c682bc |
#
|
|
|
c682bc |
-# Copyright (C) 2007 Red Hat, Inc.
|
|
|
c682bc |
+# Copyright (C) 2007-2015 Red Hat, Inc.
|
|
|
c682bc |
#
|
|
|
c682bc |
# This program is free software; you can redistribute it and/or modify
|
|
|
c682bc |
# it under the terms of the GNU General Public License as published by
|
|
|
c682bc |
@@ -54,6 +54,7 @@ class pidstat:
|
|
|
c682bc |
PF_SPREAD_PAGE = 0x01000000
|
|
|
c682bc |
PF_SPREAD_SLAB = 0x02000000
|
|
|
c682bc |
PF_THREAD_BOUND = 0x04000000
|
|
|
c682bc |
+ PF_NO_SETAFFINITY = 0x04000000 # /* Userland is not allowed to meddle with cpus_allowed */
|
|
|
c682bc |
PF_MEMPOLICY = 0x10000000
|
|
|
c682bc |
PF_MUTEX_TESTER = 0x20000000
|
|
|
c682bc |
PF_FREEZER_SKIP = 0x40000000
|
|
|
c682bc |
--
|
|
|
c682bc |
1.8.3.1
|
|
|
c682bc |
|