Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp478665imm; Wed, 11 Jul 2018 06:00:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf7RFzeRVqRfiiLirbfJQpCYffXaec3K6mCZbEh2rFxQVYD+OEA/EMEaFdWJ+8cAoPY8n2H X-Received: by 2002:a17:902:622:: with SMTP id 31-v6mr28544255plg.135.1531314041422; Wed, 11 Jul 2018 06:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531314041; cv=none; d=google.com; s=arc-20160816; b=KkLX+ZWgjmTCco+3BTLTEeh7p3oZpHvVOEzYY88P+Lo3laRct+Xyg8jk+MUtBSgaR0 uC6M29lRZpDGhwWRmn7e/mYC4DZiEzlHDD1Pjg0UXSFmo5s9SNkS3+uqhR4a1FxY6T6w Zttwllen234+4TLrhb4jBYqYpZpUBqR1quAEN2zV568W7GlBmxfHpNLATpVdDuC54rtP 1LzOYAXoGMKn61R+OypNpQYqwDUnhDUjB7ftvg0EIAin91N/qaj9gPizQJEa27Q/TtFa YpQaMM9hcDgJdyEVJJQc8TyfMayHduLQ6G8+BoM07P1gkgO2vJPUz0vV9oVO6v+d+BWT RUyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=eysw1jUDjYwbovqlhsU1x1FDLsgrT+pixq2c6Wn0Kqw=; b=L9+4GBqMKazOnqwP9BgSqHiLHUznuGM7gHb3ylFFH8hhgX6inEZfT+ixgk0NMXU+nf ZgaZXzr4c/7nmT93DoKIPrwOcpgdsfwGv7fpENIGIeKg4/Uhj76ACNRqkdPEOvB6HyJL kes0FeFiuZHBPHYTIuUG5uReA+fbkvlnhki8RS2TE7Nipl/v7OVDAOZTinT0uNc6TeFX eNrPnp3D6LJNWYiDB1NLvv+8uVO01C2I4nX2xZs4gX+VAnWgQrPgSa/R6DTDXN7Zgw6B oN8CJfZYkuh+dk2piybb7xlV5JtQ7QzL2FBdKguEMF6CtAINW41+rjPwd94MiFAlxc2G TBaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=MffiXvQe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69-v6si19257307pla.288.2018.07.11.06.00.23; Wed, 11 Jul 2018 06:00:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=MffiXvQe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732963AbeGKM4i (ORCPT + 99 others); Wed, 11 Jul 2018 08:56:38 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41154 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbeGKM4i (ORCPT ); Wed, 11 Jul 2018 08:56:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DI0JlLfOsUYkXVK2q0VUAzsD6xYqZqtR0psnDJjQvPc=; b=MffiXvQehfPl/lZmbKuEJwCX5 WS4k2/LAmNZeQasGJrqQn63eFCjhhQL1jsdhn8ydYE7odwPrDxxdac+TDXg2DIP45446SBStgzSzq JZw13EF3wjMF/zhEtdpnWAAFzj/EjIoICMTeY8k5zcwg1sW8oDb+nZhWV8TWrvOG+eeZyYckxuNOf w1VrHjgU0ZtH+PP2DjMOeFjXIRLKNzsLgOn/UD24jn3vPoV4hkKHJbdaoE/wESLgnviAm1mmadJaT WQQpg0nnr/X/iMl0QEM1nQpwTMmA8UA2Hl/3kXsIZg85nwwOcgXMN4WbdqCkK36cRur0iE/+myo/G pu71aUsng==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdEbU-0008Ha-5p; Wed, 11 Jul 2018 12:52:20 +0000 Date: Wed, 11 Jul 2018 05:52:19 -0700 From: Matthew Wilcox To: Dominique Martinet Cc: v9fs-developer@lists.sourceforge.net, Latchesar Ionkov , Eric Van Hensbergen , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Ron Minnich Subject: Re: [V9fs-developer] [PATCH 2/6] 9p: Replace the fidlist with an IDR Message-ID: <20180711125219.GA23640@bombadil.infradead.org> References: <20180628132629.3148-1-willy@infradead.org> <20180628132629.3148-3-willy@infradead.org> <20180711124038.GB835@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711124038.GB835@nautica> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 11, 2018 at 02:40:38PM +0200, Dominique Martinet wrote: > Matthew Wilcox wrote on Thu, Jun 28, 2018: > > diff --git a/net/9p/client.c b/net/9p/client.c > > index f8d58b0852fe..bbab82f22c20 100644 > > --- a/net/9p/client.c > > +++ b/net/9p/client.c > > @@ -908,30 +908,27 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt) > > - ret = p9_idpool_get(clnt->fidpool); > > - if (ret < 0) > > - goto error; > > - fid->fid = ret; > > - ... > > + idr_preload(GFP_KERNEL); > > + spin_lock_irq(&clnt->lock); > > + ret = idr_alloc_u32(&clnt->fids, fid, &fid->fid, UINT_MAX, GFP_NOWAIT); > > There's also a P9_NOFID that we shouldn't use, so the max here should be > P9_NOFID - 1 Happy to fix that. It shouldn't actually happen, of course. I can't imagine us having 4 billion FIDs in use at once. > That aside this introduces a change of behaviour that fid used to be > alloc'd linearily from 0 which no longer holds true, that breaks one > serveur (nfs-ganesha just returns ERANGE) but others seem to handle this > just fine so they'll just need to fix that server. > max aside this looks good. I don't understand your assertion that this is a change of behaviour. The implementation of p9_idpool_get() uses idr_alloc(), not idr_alloc_cyclic(), so I don't believe I've changed which FID would be allocated.