All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: Ceph Development <ceph-devel@vger.kernel.org>,
	"Yan, Zheng" <zyan@redhat.com>, Sage Weil <sage@redhat.com>
Subject: Re: [PATCH v2 01/13] ceph: add new r_req_flags field to ceph_mds_request
Date: Wed, 01 Feb 2017 14:14:18 -0500	[thread overview]
Message-ID: <1485976458.2559.1.camel@redhat.com> (raw)
In-Reply-To: <CAOi1vP9BszmpzTfM-gC2+JGY4MZeJJfAZPhNh+uXYJpKKwHjqw@mail.gmail.com>

On Wed, 2017-02-01 at 20:10 +0100, Ilya Dryomov wrote:
> On Wed, Feb 1, 2017 at 6:47 PM, Jeff Layton <jlayton@redhat.com> wrote:
> > On Wed, 2017-02-01 at 15:08 +0100, Ilya Dryomov wrote:
> > > On Wed, Feb 1, 2017 at 12:49 PM, Jeff Layton <jlayton@redhat.com> wrote:
> > > > ...and start moving bool flags into it.
> > > > 
> > > > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > > > ---
> > > >  fs/ceph/dir.c        | 2 +-
> > > >  fs/ceph/mds_client.c | 2 +-
> > > >  fs/ceph/mds_client.h | 4 +++-
> > > >  3 files changed, 5 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> > > > index d4385563b70a..04fa4ae3deca 100644
> > > > --- a/fs/ceph/dir.c
> > > > +++ b/fs/ceph/dir.c
> > > > @@ -371,7 +371,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx)
> > > >                 /* hints to request -> mds selection code */
> > > >                 req->r_direct_mode = USE_AUTH_MDS;
> > > >                 req->r_direct_hash = ceph_frag_value(frag);
> > > > -               req->r_direct_is_hash = true;
> > > > +               set_bit(CEPH_MDS_R_DIRECT_IS_HASH, &req->r_req_flags);
> > > 
> > > Hi Jeff,
> > > 
> > > Just a couple of nits:
> > > 
> > > These are atomic -- should probably mention in the commit message why
> > > is atomicity needed.
> > > 
> > 
> > It's not strictly needed for most of this stuff. DIRECT_IS_HASH in
> > particular could just use __set_bit.
> > 
> > The rest of the flags, I think are already protected from concurrent
> > writes by mutexes in the code. What I'm not sure of is whether they are
> > protected by the _same_ lock. That's a requirement if we mix all of the
> > flags together into the same word and don't want to use the atomic
> > *_bit macros.
> > 
> > I can look and see if that's possible. Even if it's not though, using
> > the atomic *_bit macros is generally not that expensive (particularly
> > in a situation where we're already using sleeping locks anyway).
> 
> Auditing for whether __set_bit, etc can be used instead is probably not
> worth it.  I'm not saying we shouldn't use atomic bitops here -- just
> wanted to get this explanation in the commit message.
> 
> 

Thanks, done. I went ahead and changed DIRECT_IS_HASH to use __set_bit
(it's pretty clear that that's safe there), but the others do need the
atomic versions as they can have other tasks manipulating them.

I went ahead and merged the squashed set into ceph-client/testing with
an updated commit message. Let me know if you see any other issues with
the set.

-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2017-02-01 19:14 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 16:19 [PATCH 0/5] ceph: fix performance regression due to ceph_d_revalidate fixes Jeff Layton
2017-01-30 16:19 ` [PATCH 1/5] ceph: don't update_dentry_lease unless we actually got one Jeff Layton
2017-01-30 16:19 ` [PATCH 2/5] ceph: vet the parent inode before updating dentry lease Jeff Layton
2017-01-30 16:19 ` [PATCH 3/5] ceph: clean up r_aborted handling in ceph_fill_trace Jeff Layton
2017-01-30 16:19 ` [PATCH 4/5] ceph: call update_dentry_lease even when r_locked dir is not set Jeff Layton
2017-01-30 16:19 ` [PATCH 5/5] ceph: do a LOOKUP in d_revalidate instead of GETATTR Jeff Layton
2017-02-01 11:49 ` [PATCH v2 00/13] ceph: fix performance regression due to ceph_d_revalidate fixes Jeff Layton
2017-02-01 11:49   ` [PATCH v2 01/13] ceph: add new r_req_flags field to ceph_mds_request Jeff Layton
2017-02-01 14:08     ` Ilya Dryomov
2017-02-01 17:47       ` Jeff Layton
2017-02-01 19:10         ` Ilya Dryomov
2017-02-01 19:14           ` Jeff Layton [this message]
2017-02-01 11:49   ` [PATCH v2 02/13] ceph: move r_aborted flag into r_req_flags Jeff Layton
2017-02-02  8:06     ` Yan, Zheng
2017-02-02 11:26       ` Jeff Layton
2017-02-02 15:16         ` Yan, Zheng
2017-02-02 15:27           ` Jeff Layton
2017-02-01 11:49   ` [PATCH v2 03/13] ceph: move r_got_unsafe " Jeff Layton
2017-02-01 11:49   ` [PATCH v2 04/13] ceph: move r_got_safe " Jeff Layton
2017-02-01 11:49   ` [PATCH v2 05/13] ceph: move r_got_result " Jeff Layton
2017-02-01 11:49   ` [PATCH v2 06/13] ceph: move r_did_prepopulate " Jeff Layton
2017-02-01 11:49   ` [PATCH v2 07/13] ceph: remove "Debugging hook" from ceph_fill_trace Jeff Layton
2017-02-01 11:49   ` [PATCH v2 08/13] ceph: don't need session pointer to ceph_fill_trace Jeff Layton
2017-02-01 11:49   ` [PATCH v2 09/13] ceph: add a new flag to indicate whether parent is locked Jeff Layton
2017-02-01 11:49   ` [PATCH v2 10/13] ceph: don't update_dentry_lease unless we actually got one Jeff Layton
2017-02-01 11:49   ` [PATCH v2 11/13] ceph: vet the parent inode before updating dentry lease Jeff Layton
2017-02-01 11:49   ` [PATCH v2 12/13] ceph: call update_dentry_lease even when r_locked dir is not set Jeff Layton
2017-02-02  8:34     ` Yan, Zheng
2017-02-02 11:27       ` Jeff Layton
2017-02-01 11:49   ` [PATCH v2 13/13] ceph: do a LOOKUP in d_revalidate instead of GETATTR Jeff Layton
2017-02-03 18:03   ` [PATCH v3 0/8] ceph: fix performance regression due to ceph_d_revalidate fixes Jeff Layton
2017-02-03 18:03     ` [PATCH v3 1/8] ceph: remove "Debugging hook" from ceph_fill_trace Jeff Layton
2017-02-03 18:03     ` [PATCH v3 2/8] ceph: drop session argument to ceph_fill_trace Jeff Layton
2017-02-03 18:03     ` [PATCH v3 3/8] ceph: convert bools in ceph_mds_request to a new r_req_flags field Jeff Layton
2017-02-03 18:04     ` [PATCH v3 4/8] ceph: add a new flag to indicate whether parent is locked Jeff Layton
2017-02-04  3:16       ` Yan, Zheng
2017-02-04 11:40         ` Jeff Layton
2017-02-03 18:04     ` [PATCH v3 5/8] ceph: don't update_dentry_lease unless we actually got one Jeff Layton
2017-02-03 18:04     ` [PATCH v3 6/8] ceph: vet the target and parent inodes before updating dentry lease Jeff Layton
2017-02-04  3:20       ` Yan, Zheng
2017-02-04 11:37         ` Jeff Layton
2017-02-03 18:04     ` [PATCH v3 7/8] ceph: call update_dentry_lease even when r_locked dir is not set Jeff Layton
2017-02-03 18:04     ` [PATCH v3 8/8] ceph: do a LOOKUP in d_revalidate instead of GETATTR Jeff Layton
2017-02-04  3:25     ` [PATCH v3 0/8] ceph: fix performance regression due to ceph_d_revalidate fixes Yan, Zheng

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=1485976458.2559.1.camel@redhat.com \
    --to=jlayton@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=sage@redhat.com \
    --cc=zyan@redhat.com \
    /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.