linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v2] ceph: use frag's MDS in either mode
@ 2020-07-31  8:25 Yanhu Cao
  2020-07-31 11:57 ` Jeff Layton
  0 siblings, 1 reply; 3+ messages in thread
From: Yanhu Cao @ 2020-07-31  8:25 UTC (permalink / raw)
  To: jlayton; +Cc: idryomov, ceph-devel, linux-kernel, Yanhu Cao

When doing some tests with multiple mds, there are many
mds forwarding requests between them and then the client request
is resent.

If the request is a modification operation and the mode is set to USE_AUTH_MDS.
Auth mds should be selected to handle the request, and if auth mds for
frag is already set, it can be returned directly without the logic behind it.

But the current logic doesn't return directly because the condition
'mode == USE_AUTH_MDS', and sometimes frag's mds is not equal to
cap's session mds, which then causes the request to be resent.

Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
---
 fs/ceph/mds_client.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index a50497142e59..b2255a9be7c0 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1103,8 +1103,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
 				     frag.frag, mds);
 				if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
 				    CEPH_MDS_STATE_ACTIVE) {
-					if (mode == USE_ANY_MDS &&
-					    !ceph_mdsmap_is_laggy(mdsc->mdsmap,
+					if (!ceph_mdsmap_is_laggy(mdsc->mdsmap,
 								  mds))
 						goto out;
 				}
-- 
2.24.3 (Apple Git-128)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [v2] ceph: use frag's MDS in either mode
  2020-07-31  8:25 [v2] ceph: use frag's MDS in either mode Yanhu Cao
@ 2020-07-31 11:57 ` Jeff Layton
  2020-08-03  1:25   ` Yanhu Cao
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2020-07-31 11:57 UTC (permalink / raw)
  To: Yanhu Cao; +Cc: idryomov, ceph-devel, linux-kernel

On Fri, 2020-07-31 at 16:25 +0800, Yanhu Cao wrote:
> When doing some tests with multiple mds, there are many
> mds forwarding requests between them and then the client request
> is resent.
> 
> If the request is a modification operation and the mode is set to USE_AUTH_MDS.
> Auth mds should be selected to handle the request, and if auth mds for
> frag is already set, it can be returned directly without the logic behind it.
> 
> But the current logic doesn't return directly because the condition
> 'mode == USE_AUTH_MDS', and sometimes frag's mds is not equal to
> cap's session mds, which then causes the request to be resent.
> 
> Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
> ---
>  fs/ceph/mds_client.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index a50497142e59..b2255a9be7c0 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -1103,8 +1103,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
>  				     frag.frag, mds);
>  				if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
>  				    CEPH_MDS_STATE_ACTIVE) {
> -					if (mode == USE_ANY_MDS &&
> -					    !ceph_mdsmap_is_laggy(mdsc->mdsmap,
> +					if (!ceph_mdsmap_is_laggy(mdsc->mdsmap,
>  								  mds))
>  						goto out;
>  				}


Much better! A good changelog is as important as the patch, esp in code
like this that is quite non-obvious.

Merged into testing branch. I did clean up the changelog a bit before I
merged it. Please take a look when you have time and let me know if you
think I got it wrong.

Thanks!
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [v2] ceph: use frag's MDS in either mode
  2020-07-31 11:57 ` Jeff Layton
@ 2020-08-03  1:25   ` Yanhu Cao
  0 siblings, 0 replies; 3+ messages in thread
From: Yanhu Cao @ 2020-08-03  1:25 UTC (permalink / raw)
  To: Jeff Layton; +Cc: Ilya Dryomov, ceph-devel, LKML

On Fri, Jul 31, 2020 at 7:57 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> On Fri, 2020-07-31 at 16:25 +0800, Yanhu Cao wrote:
> > When doing some tests with multiple mds, there are many
> > mds forwarding requests between them and then the client request
> > is resent.
> >
> > If the request is a modification operation and the mode is set to USE_AUTH_MDS.
> > Auth mds should be selected to handle the request, and if auth mds for
> > frag is already set, it can be returned directly without the logic behind it.
> >
> > But the current logic doesn't return directly because the condition
> > 'mode == USE_AUTH_MDS', and sometimes frag's mds is not equal to
> > cap's session mds, which then causes the request to be resent.
> >
> > Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
> > ---
> >  fs/ceph/mds_client.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> > index a50497142e59..b2255a9be7c0 100644
> > --- a/fs/ceph/mds_client.c
> > +++ b/fs/ceph/mds_client.c
> > @@ -1103,8 +1103,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
> >                                    frag.frag, mds);
> >                               if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
> >                                   CEPH_MDS_STATE_ACTIVE) {
> > -                                     if (mode == USE_ANY_MDS &&
> > -                                         !ceph_mdsmap_is_laggy(mdsc->mdsmap,
> > +                                     if (!ceph_mdsmap_is_laggy(mdsc->mdsmap,
> >                                                                 mds))
> >                                               goto out;
> >                               }
>
>
> Much better! A good changelog is as important as the patch, esp in code
> like this that is quite non-obvious.
>
> Merged into testing branch. I did clean up the changelog a bit before I
> merged it. Please take a look when you have time and let me know if you
> think I got it wrong.
LGTM.

Thanks.
>
> Thanks!
> --
> Jeff Layton <jlayton@kernel.org>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-03  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  8:25 [v2] ceph: use frag's MDS in either mode Yanhu Cao
2020-07-31 11:57 ` Jeff Layton
2020-08-03  1:25   ` Yanhu Cao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).