Re: [V9fs-developer] [PATCH v2 3/6] 9p: Replace the fidlist with an IDR

2018-07-12 Thread Matthew Wilcox
On Fri, Jul 13, 2018 at 10:05:50AM +0800, jiangyiwen wrote: > > @@ -908,30 +908,29 @@ static struct p9_fid *p9_fid_create(struct p9_client > > *clnt) > > { > > int ret; > > struct p9_fid *fid; > > - unsigned long flags; > > > > p9_debug(P9_DEBUG_FID, "clnt %p\n", clnt); > > fi

Re: [V9fs-developer] [PATCH v2 3/6] 9p: Replace the fidlist with an IDR

2018-07-12 Thread jiangyiwen
On 2018/7/12 5:02, Matthew Wilcox wrote: > The p9_idpool being used to allocate the IDs uses an IDR to allocate > the IDs ... which we then keep in a doubly-linked list, rather than in > the IDR which allocated them. We can use an IDR directly which saves > two pointers per p9_fid, and a tiny memo

Re: [PATCH v2 3/6] 9p: Replace the fidlist with an IDR

2018-07-12 Thread Dominique Martinet
Matthew Wilcox wrote on Thu, Jul 12, 2018: > > Ah, I had missed that you didn't update this memset as you said in reply > > to comment on v1. > > Rather than update the memset, I ... > > > Could you resend just this patch and either initialize fid->fid or use > > kzalloc for the fid allocation?

Re: [PATCH v2 3/6] 9p: Replace the fidlist with an IDR

2018-07-12 Thread Matthew Wilcox
On Thu, Jul 12, 2018 at 01:17:26PM +0200, Dominique Martinet wrote: > Matthew Wilcox wrote on Wed, Jul 11, 2018: > > diff --git a/net/9p/client.c b/net/9p/client.c > > index 389a2904b7b3..b89c7298267c 100644 > > --- a/net/9p/client.c > > +++ b/net/9p/client.c > > memset(&fid->qid, 0, sizeof(str

Re: [PATCH v2 3/6] 9p: Replace the fidlist with an IDR

2018-07-12 Thread Dominique Martinet
Matthew Wilcox wrote on Wed, Jul 11, 2018: > diff --git a/net/9p/client.c b/net/9p/client.c > index 389a2904b7b3..b89c7298267c 100644 > --- a/net/9p/client.c > +++ b/net/9p/client.c > @@ -908,30 +908,29 @@ static struct p9_fid *p9_fid_create(struct p9_client > *clnt) > { > int ret; >

[PATCH v2 3/6] 9p: Replace the fidlist with an IDR

2018-07-11 Thread Matthew Wilcox
The p9_idpool being used to allocate the IDs uses an IDR to allocate the IDs ... which we then keep in a doubly-linked list, rather than in the IDR which allocated them. We can use an IDR directly which saves two pointers per p9_fid, and a tiny memory allocation per p9_client. Signed-off-by: Matt