From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 099641A3179; Thu, 6 Nov 2025 15:00:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762441256; cv=none; b=BH4X1C2uguL/sWvIebwtMFwciGi5xLZ0QQwGH729evLklvIvSiNSCDeD/OXUajF5eQUO5Xj5TMrf2qehwUGwPVSslNi+sTPlFVVjv9BjzQ70mgGtxxRE68SO1TibcH404mw0cqY8nN45lgu9vBmd/HAHY6M5pDodSaCsbRZUx+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762441256; c=relaxed/simple; bh=DHx5Gn/zRq9/QYaOscwbgOy0T1R7dI032wNeOlgn9fg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aRHqeNVAceUQUtNDAdO9WSGaBT1MtuQMKr4/7mwEanyuMp1v4trwvDHrRtiICNpHyk2VLLBld/C/5+hTCitVIqBzIEkP/zjo+6QBnVU99mfXB9vIq1CwK30N31kraNXKwPmOBkeyDDuJX9l3WJpSzdpsqmf0inr/NIfXWTjuCDg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 8E486227AAE; Thu, 6 Nov 2025 16:00:49 +0100 (CET) Date: Thu, 6 Nov 2025 16:00:49 +0100 From: Christoph Hellwig To: Vlastimil Babka Cc: Christoph Hellwig , Jens Axboe , Eric Biggers , Andrew Morton , Christoph Lameter , David Rientjes , Roman Gushchin , Harry Yoo , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 3/9] mempool: add mempool_{alloc,free}_bulk Message-ID: <20251106150049.GA16252@lst.de> References: <20251031093517.1603379-1-hch@lst.de> <20251031093517.1603379-4-hch@lst.de> <1fff522d-1987-4dcc-a6a2-4406a22d3ec2@suse.cz> <20251106141306.GA12043@lst.de> <20251106144846.GA15119@lst.de> Precedence: bulk X-Mailing-List: linux-fscrypt@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Nov 06, 2025 at 03:57:13PM +0100, Vlastimil Babka wrote: > > I think the only reason mempool_alloc even allows !__GFP_DIRECT_RECLAIM > > is to avoid special casing that in callers that have a non-constant > > gfp mask. So maybe the best thing would be to never actually go to > > the pool for them and just give up if alloc_fn fails? > > Yeah, but I guess we could keep trying the pool for the single allocation > case as that's simple enough, just not for the bulk. Doing that will be quite a bit more complicated I think. And given that the !__GFP_DIRECT_RECLAIM handlers must be able to handle failure I'm also not sure that using the pool is all that useful.