Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp158461pxb; Fri, 15 Oct 2021 02:57:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQSWS9qP35zpmEZxHjpFkb3aP+dVDjcjv8RQFEfSQ38AWlWEWXK1UU652x8AdAINYXAobV X-Received: by 2002:a17:906:9601:: with SMTP id s1mr5998574ejx.68.1634291865297; Fri, 15 Oct 2021 02:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634291865; cv=none; d=google.com; s=arc-20160816; b=PzGhL1U+RMtXh7Mmf8qDwPQm7jB1qxgYuF1SVpV+8Fhrbxc+F+lKrtjyEzoVnoFFWv Y9TP6pU3x6VC4ISD6wY/qkB5aGBpOg+fOBd8HoGSsBkvacF1IaYJYUeOVbDLLS+5QeKn 1jwvqG8cU24FgVpAt0amFtC7P4aitmXIUD4pv7TBdHaN/eyYPveUNLQojv+QazkjCZTo qrFZM2a/YT6PJZKtL9fgqKZi4rUBXacDRUtr08+phgBBfvrbDh6vcD/cQxKE6qBjJrwI xSfxizl3QCTrp1c4co0LMC+WV0nsfZnUAb3RgVXPKd+qm54widd36YcP7iAXDORYkvSo 7Txg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YMJ4ZcnlHEiGTctOOzh6sM+AvrPdXIijWHvRrcl0AgM=; b=aNGw3qw9knYeTbbWJ8XO8eNHcQ2xSEdYMiKURQkaCtaoDIN+7AjeXbMY3S3g5gqLPH /E/yEQVXvDKFhzXXU3jswzxdyP81E4s/Wwh+f9Zw/UNMqYWkOXeNS6GSHoVRtwtKiaze YGLn3pxtxJGK3Zy2NiF3j3QyXcg5BJZY2AYrua0LKpSoM0oUdqYhN4/I2nEd4cWHIH0B 01CoKNlH07Hz95vVLZtGMTJrmeVpnE1w5kEkQTi63gzR9aCKhCfpmv+Wi39pwDhVE20r EXNF8t0nFqXTm1IC/NvtpQu1inBUTc4jxa8Cog9iSgr21oj1AkfsxcdEhFrXUmmm0UsK Rd1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=snUtZ9ex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs5si11051819ejc.359.2021.10.15.02.57.21; Fri, 15 Oct 2021 02:57:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=snUtZ9ex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234723AbhJOA7m (ORCPT + 99 others); Thu, 14 Oct 2021 20:59:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:37198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234745AbhJOA7f (ORCPT ); Thu, 14 Oct 2021 20:59:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C6E8461040; Fri, 15 Oct 2021 00:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634259449; bh=WFqaaGetsrU0F1LXNipYaIrryMD5ZYTRfecIsz8rLq8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=snUtZ9excOZNnlFFMRUeJVIxjWJFru1Xvrjr8xypife31DULY3UMsHv/mzQYLm0MG c9DxNx3iz2b741uRBsnAMYRZ+n1uDj8mCPhiw5S4bGh+diRuhvtguhDaKgMyzVNPZJ JMqzlqoOm0y4OKUSb6bYHxmoZL/bAftajHT41L60WYI5G2r0aIP/0RT10ferHe+p3u fFaj0Te7y9rhfifV+KsydswLpAWBKsvPSTk4yFR929qVA6SrgPJ06LFpK9R2i6QtXE 39BAhklqvLUNInES41D5KZmnAg0pRVkCWRpIrusVtvG31ZOFmiyzB57FODAtapjC4w k1qCMqgGYq9Tg== Date: Thu, 14 Oct 2021 17:57:29 -0700 From: "Darrick J. Wong" To: Rustam Kovhaev Cc: Vlastimil Babka , David Rientjes , Dave Chinner , linux-xfs@vger.kernel.org, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, gregkh@linuxfoundation.org, Al Viro , dvyukov@google.com Subject: Re: [PATCH] xfs: use kmem_cache_free() for kmem_cache objects Message-ID: <20211015005729.GD24333@magnolia> References: <1e0df91-556e-cee5-76f7-285d28fe31@google.com> <20211012204320.GP24307@magnolia> <20211012204345.GQ24307@magnolia> <9db5d16a-2999-07a4-c49d-7417601f834f@suse.cz> <20211012232255.GS24307@magnolia> <3928ef69-eaac-241c-eb32-d2dd2eab9384@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 09:56:41AM -0700, Rustam Kovhaev wrote: > On Wed, Oct 13, 2021 at 09:38:31AM +0200, Vlastimil Babka wrote: > > On 10/13/21 01:22, Darrick J. Wong wrote: > > > On Tue, Oct 12, 2021 at 11:32:25PM +0200, Vlastimil Babka wrote: > > >> On 10/12/2021 10:43 PM, Darrick J. Wong wrote: > > >> > On Tue, Oct 12, 2021 at 01:43:20PM -0700, Darrick J. Wong wrote: > > >> >> On Sun, Oct 03, 2021 at 06:07:20PM -0700, David Rientjes wrote: > > >> >> > > >> >> I audited the entire xfs (kernel) codebase and didn't find any other > > >> >> usage errors. Thanks for the patch; I'll apply it to for-next. > > >> > > >> Which patch, the one that started this thread and uses kmem_cache_free() instead > > >> of kfree()? I thought we said it's not the best way? > > > > > > It's probably better to fix slob to be able to tell that a kmem_free'd > > > object actually belongs to a cache and should get freed that way, just > > > like its larger sl[ua]b cousins. > > > > Agreed. Rustam, do you still plan to do that? > > Yes, I do, thank you. Note that I left out the parts of the patch that changed mm/slob.c because I didn't think that was appropriate for a patch titled 'xfs:'. > > > > > > However, even if that does come to pass, anybody /else/ who wants to > > > start(?) using XFS on a SLOB system will need this patch to fix the > > > minor papercut. Now that I've checked the rest of the codebase, I don't > > > find it reasonable to make XFS mutually exclusive with SLOB over two > > > instances of slab cache misuse. Hence the RVB. :) > > > > Ok. I was just wondering because Dave's first reply was that actually you'll > > need to expand the use of kfree() instead of kmem_cache_free(). I look forward to doing this, but since XFS is a downstream consumer of the kmem apis, we'll have to wait until the slob changes land to do that. --D