From: Dipankar Sarma <dipankar@in.ibm.com>
To: Suzanne Wood <suzannew@cs.pdx.edu>
Cc: bunk@stusta.de, linux-kernel@vger.kernel.org,
nickpiggin@yahoo.com.au, paulmck@us.ibm.com
Subject: Re: 2.6.16-rc regression: m68k CONFIG_RMW_INSNS=n compile broken
Date: Mon, 6 Mar 2006 22:18:25 +0530 [thread overview]
Message-ID: <20060306164825.GA5646@in.ibm.com> (raw)
In-Reply-To: <200603061613.k26GDfD0017783@wezen.cs.pdx.edu>
On Mon, Mar 06, 2006 at 08:13:41AM -0800, Suzanne Wood wrote:
> Thank you very much.
> > > struct file fastcall *fget_light(unsigned int fd, int *fput_needed)
> > > {
> > > struct file *file;
> > > struct files_struct *files = current->files;
> > >
> > > *fput_needed = 0;
> > > if (likely((atomic_read(&files->count) == 1))) {
> > > file = fcheck_files(files, fd);
> > > } else {
>
> > This means that the fd table is not shared between threads. So,
> > there can't be any race and no need to protect using
> > rcu_read_lock()/rcu_read_unlock().
>
> Then why call fcheck_files() with the rcu_dereference() which would flag
> an automated check for the need to mark a read-side critical section?
> Would it make sense to introduce the function that doesn't? The goal of
> keeping the kernel small is balanced with clarity. The inconsistency of
> how fcheck_files() is used within a single function (fget_light()) was
> my opening question.
Because rcu_dereference() hurts only alpha and we don't care about
alpha :-)
Just kidding!
Good point about automated checkers. However, this isn't an
uncommon thing in multi-threaded programs - can't the checker
rules be written to take into account sharing and non-sharing of
the object in question ?
Thanks
Dipankar
next prev parent reply other threads:[~2006-03-06 16:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-06 16:13 2.6.16-rc regression: m68k CONFIG_RMW_INSNS=n compile broken Suzanne Wood
2006-03-06 16:48 ` Dipankar Sarma [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-03-07 1:14 Suzanne Wood
2006-03-06 4:44 Suzanne Wood
2006-03-06 15:35 ` Dipankar Sarma
2006-02-27 5:27 Linux v2.6.16-rc5 Linus Torvalds
2006-03-03 23:01 ` 2.6.16-rc regression: m68k CONFIG_RMW_INSNS=n compile broken Adrian Bunk
2006-03-03 23:22 ` Linus Torvalds
2006-03-03 23:43 ` Adrian Bunk
2006-03-03 23:59 ` Andrew Morton
2006-03-04 14:01 ` Roman Zippel
2006-03-04 14:12 ` Nick Piggin
2006-03-04 20:28 ` Andrew Morton
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=20060306164825.GA5646@in.ibm.com \
--to=dipankar@in.ibm.com \
--cc=bunk@stusta.de \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=paulmck@us.ibm.com \
--cc=suzannew@cs.pdx.edu \
/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