All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk" <mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
To: Loic Domaigne <tech-Z4JMKDdsf89Wk0Htik3J/w@public.gmane.org>,
	Paul Jackson <pj-sJ/iWh9BUns@public.gmane.org>
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	josv-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	"brian m. carlson"
	<sandals-spVehEqlxw627WubY2PhZQivdfXVPZ6z@public.gmane.org>,
	Bert Wesarg <bert.wesarg-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>,
	Stefan Puiu
	<stefanpuiuro-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>,
	Karsten Weiss
	<K.Weiss-Pt+Xe7GJXK+P2YhJcF5u+nqWYbMAw+HU@public.gmane.org>
Subject: Re: For review: pthread_setaffinity_np.3
Date: Fri, 14 Nov 2008 10:38:56 -0500	[thread overview]
Message-ID: <cfd18e0f0811140738i33f2c671kc99bbb7750f2fa44@mail.gmail.com> (raw)
In-Reply-To: <cfd18e0f0811140704l18e5741fgdbb5a6c52fb8cbe7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[CC += "Paul Jackson" <pj-sJ/iWh9BUns@public.gmane.org>, who might want to Ack the patch below]

>> This might be obvious to all of you, but it wasn't to me... The CPU set used
>> for the affinity is the intersection of the set passed to
>> pthread_setaffinity_np() and the set of processors supported by the
>> kernel...
>>
>> That's why your example shall work, even if the system where it runs has
>> less than 8 processors.
>
> It's true.  The page should say something to make this clearer.  I
> added this text to NOTES
>
>       After a call to  pthread_setaffinity_np(3),  the  set  of
>       CPUs  on which the thread will actually run is the inter-
>       section of the set specified in the cpuset  argument  and
>       the set of CPUs actually present on the system.  The sys-
>       tem may further restrict the set of  CPUs  on  which  the
>       thread  runs  if  the  "cpuset"  mechanism  described  in
>       cpuset(7) is  being  used.   These  restrictions  on  the
>       actual  set  of  CPUs  on  which  the thread will run are
>       silently imposed by the kernel.

Of course, the sched_setaffinity.2 page also deserves similar text.  I
made the change below.

Look ok?

Cheers,

Michael

--- a/man2/sched_setaffinity.2
+++ b/man2/sched_setaffinity.2

@@ -122,7 +122,10 @@ A supplied memory address was invalid.
 .B EINVAL
 The affinity bit mask
 .I mask
-contains no processors that are physically on the system.
+contains no processors that are currently physically on the system
+and permitted to the process according to any restrictions that
+may be imposed by the "cpuset" mechanism described in
+.BR cpuset (7).
 .TP
 .B EINVAL
 .RB ( sched_getaffinity ()
@@ -157,6 +160,19 @@ argument was removed, but was then restored in glibc 2.3.4,
 with type
 .SH "CONFORMING TO"
 These system calls are Linux-specific.
 .SH "NOTES"
+After a call to
+.BR sched_setaffinity (),
+the set of CPUs on which the process will actually run is
+the intersection of the set specified in the
+.I mask
+argument and the set of CPUs actually present on the system.
+The system may further restrict the set of CPUs on which the process
+runs if the "cpuset" mechanism described in
+.BR cpuset (7)
+is being used.
+These restrictions on the actual set of CPUs on which the process
+will run are silently imposed by the kernel.
+
 .BR sched_setscheduler (2)
 has a description of the Linux scheduling scheme.
 .PP
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2008-11-14 15:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04 22:47 For review: pthread_setaffinity_np.3 Michael Kerrisk
     [not found] ` <cfd18e0f0811041447w57dd5de4he68ca780ed963074-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-05 18:00   ` Bert Wesarg
     [not found]     ` <36ca99e90811051000j619ff316u8c836352627fe4a0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-06 19:32       ` Michael Kerrisk
2008-11-08 22:31   ` Loic Domaigne
     [not found]     ` <4916133A.8060209-Z4JMKDdsf89Wk0Htik3J/w@public.gmane.org>
2008-11-10 18:38       ` Bert Wesarg
     [not found]         ` <36ca99e90811101038v62348fc0mbb366219168bf2ff-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-13  2:30           ` Michael Kerrisk
     [not found]             ` <cfd18e0f0811121830u3dc6ea30va0298bdbedf1f2fb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-13  7:32               ` Bert Wesarg
2008-11-14 15:04       ` Michael Kerrisk
     [not found]         ` <cfd18e0f0811140704l18e5741fgdbb5a6c52fb8cbe7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-14 15:38           ` Michael Kerrisk [this message]
     [not found]             ` <001636c5b6831e5a44045ba80779@googlemail.com>
     [not found]               ` <001636c5b6831e5a44045ba80779-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2008-11-14 15:45                 ` Delivery Status Notification (Failure) Michael Kerrisk
     [not found]                   ` <cfd18e0f0811140745k69075aend9686e463c9c1a4d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-14 15:56                     ` Bert Wesarg
     [not found]                       ` <36ca99e90811140756q7c445d5ei7c31c5b59df7c7a7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-14 16:02                         ` Michael Kerrisk
     [not found]                           ` <cfd18e0f0811140802i2c06e0am164648735fa7dda3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-14 16:26                             ` Christoph Lameter
     [not found]                               ` <Pine.LNX.4.64.0811141026080.24886-dRBSpnHQED8AvxtiuMwx3w@public.gmane.org>
2008-11-14 16:39                                 ` Christoph Lameter
     [not found]                                   ` <Pine.LNX.4.64.0811141038510.25195-dRBSpnHQED8AvxtiuMwx3w@public.gmane.org>
2008-11-14 16:43                                     ` Michael Kerrisk
     [not found]                                       ` <cfd18e0f0811140843q42971316wfade996b67aa2a6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-14 20:45                                         ` David Rientjes
     [not found]             ` <cfd18e0f0811140738i33f2c671kc99bbb7750f2fa44-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-14 15:52               ` For review: pthread_setaffinity_np.3 Bert Wesarg
     [not found]                 ` <36ca99e90811140752t1c04f87do88926777d2be614a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-14 16:04                   ` Michael Kerrisk
2008-11-14 15:50           ` Michael Kerrisk
     [not found]             ` <cfd18e0f0811140750r5a22255bx7bd53c580b42cc6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-11-15 19:41               ` Loic Domaigne
     [not found]                 ` <491F25D1.8020007-Z4JMKDdsf89Wk0Htik3J/w@public.gmane.org>
2008-11-17 17:15                   ` Michael Kerrisk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cfd18e0f0811140738i33f2c671kc99bbb7750f2fa44@mail.gmail.com \
    --to=mtk.manpages-gm/ye1e23mwn+bqq9rbeug@public.gmane.org \
    --cc=K.Weiss-Pt+Xe7GJXK+P2YhJcF5u+nqWYbMAw+HU@public.gmane.org \
    --cc=bert.wesarg-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org \
    --cc=josv-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pj-sJ/iWh9BUns@public.gmane.org \
    --cc=sandals-spVehEqlxw627WubY2PhZQivdfXVPZ6z@public.gmane.org \
    --cc=stefanpuiuro-/E1597aS9LQAvxtiuMwx3w@public.gmane.org \
    --cc=tech-Z4JMKDdsf89Wk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.