From: Stephen Hemminger <stephen@networkplumber.org>
To: Pranith Kumar <bobby.prani@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
LKML <linux-kernel@vger.kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Steven Rostedt <rostedt@goodmis.org>,
Nicholas Miell <nmiell@comcast.net>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@redhat.com>,
Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
David Howells <dhowells@redhat.com>,
Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: [PATCH v16] sys_membarrier(): system-wide memory barrier (generic, x86)
Date: Wed, 22 Apr 2015 17:40:51 -0700 [thread overview]
Message-ID: <20150422174051.5c868437@urahara> (raw)
In-Reply-To: <CAJhHMCD0Dxbsf5ZUaFbt8GvCMJDTj5d8m7tUx7GAd1=t+zED8A@mail.gmail.com>
On Wed, 22 Apr 2015 20:37:08 -0400
Pranith Kumar <bobby.prani@gmail.com> wrote:
> >> I understand why this syscall makes sense on SMP only, but you are
> >> anyways checking num_online_cpus() and returning if it is only one. Is
> >> this limitation necessary then? How do !SMP systems handle this
> >> syscall? (I am guessing glibc wrapper?)
> >
> > For !SMP, this system call is not implemented (returns -ENOSYS).
> > Userspace libs are expected to query sysconf(_SC_NPROCESSORS_CONF)
> > and check whether the system supports multiprocessor at all. If
> > only a single processor is supported by the kernel, then userspace
> > can skip the calls to sys_membarrier altogether, because they are
> > not even needed.
> >
> > Do you think this kind of information belongs in a man page ?
> >
> > Should we instead just implement the system call in !SMP, and
> > return 0 without any side-effect ? This would be a bit inefficient
> > to let userspace call a system call that has no effect whatsoever.
> >
>
> Are there any other SMP-only system calls like this? I am not really
> sure what is the right way but documenting it would be good.
The syscall should just return 0.
Let the application not worry about how many CPU's are present
next prev parent reply other threads:[~2015-04-23 0:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 15:06 [PATCH v16] sys_membarrier(): system-wide memory barrier (generic, x86) Mathieu Desnoyers
2015-04-21 11:47 ` Thomas Gleixner
2015-04-22 20:36 ` Mathieu Desnoyers
2015-04-21 16:29 ` Davidlohr Bueso
2015-04-22 19:43 ` Mathieu Desnoyers
2015-04-22 20:01 ` Michael Kerrisk (man-pages)
2015-04-22 21:01 ` Mathieu Desnoyers
2015-04-23 11:38 ` Michael Kerrisk (man-pages)
2015-04-22 20:24 ` Pranith Kumar
2015-04-22 20:40 ` Mathieu Desnoyers
2015-04-23 0:37 ` Pranith Kumar
2015-04-23 0:40 ` Stephen Hemminger [this message]
2015-04-23 2:48 ` Steven Rostedt
2015-04-23 13:45 ` Mathieu Desnoyers
2015-04-23 10:33 ` Rasmus Villemoes
2015-04-23 14:04 ` Mathieu Desnoyers
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=20150422174051.5c868437@urahara \
--to=stephen@networkplumber.org \
--cc=akpm@linux-foundation.org \
--cc=bobby.prani@gmail.com \
--cc=dhowells@redhat.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=josh@joshtriplett.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@redhat.com \
--cc=mtk.manpages@gmail.com \
--cc=nmiell@comcast.net \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox