Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3313131ybb; Sun, 22 Mar 2020 21:18:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtjlgKpq/nouBANM/UQQIBJE6Pgtu+1+st/0TGqoIksiEtJ8jDWhPO4GUBX549t6UQdORtT X-Received: by 2002:a9d:3f2:: with SMTP id f105mr6915259otf.187.1584937124298; Sun, 22 Mar 2020 21:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584937124; cv=none; d=google.com; s=arc-20160816; b=KlBjYVkaPDNsW8CM43gcVLUBtyOF0zbTnFt2AOWgZQ2UkWw5QTunDX5xNONGivqikj OADSComVx7eLWXk1iOlaj15AmIKR81IbNPbJN1TMiQEGH5LdpgyqHngPbxy57Ufnnf5n Ixd4L/4d+IssillFEqg40mesO+IWH8g5fANxUCblocua3BAtSfowumXKOOv/3Im02SQM xqFwluSoRyfSSV73dRzlFZrtbtd741NzljkgsMbODIwz3R52bCwFsr2pzwjaGRe7vCXJ 9EYhV5+ciKCwoihBhKVjS6Bk9frUSv39utyI1NsTqVS1W5bTcRfy+PBaQwdkDNQGaj+7 lHHw== 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; bh=7WAchE3q3k7aTmw0mTFTbDByfJS+RczxxN0YTdNnd4Y=; b=yy3qA9GCsOaOAZ1s20osl9BpgZk9BeGYaI2jsi+VHIYU3+JlRmqFS7cc9tP9p8scQW 0EA1ad3JYx0LWJexiQqOT57MVYiMlbvQTVn7dN6E9/vQHDxm0R4f2HJWdQIvkUEuTSsS R/qeDzjS87DDbUmWVG4yipwUGDpZEu2A+KIKsheovEbc1M4rOnsajKroxp5QbJnlcNvw KKPTAzUYwe8azYYiUgFGJGQNqN67/ErPxYcbe+Ug2pDpnBnd+h+rW/E6jWvzKJaBoWz0 V5lPQ6UsxttQiSRRJu3M6MnnGiptUADnmNLDcXH6VHfEq/kQqiA/b+UAP0W7RNS5l4bD /VYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WUCqFrmJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si6662784oii.181.2020.03.22.21.18.30; Sun, 22 Mar 2020 21:18:44 -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=pass header.i=@kernel.org header.s=default header.b=WUCqFrmJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725818AbgCWEQV (ORCPT + 99 others); Mon, 23 Mar 2020 00:16:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:52516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725208AbgCWEQV (ORCPT ); Mon, 23 Mar 2020 00:16:21 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4345620719; Mon, 23 Mar 2020 04:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584936980; bh=2VPoavb3/Nh65+u7sn+FxjbORv9J9qX5wWi4UPuIvng=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WUCqFrmJGJ1z6rhNT/5V4ZIUm7ipQ7z18II1tlu9mk47y39o93IYNZvPKW49oB+Y6 DrH3W2AubwKpH1D9rhGw5sikGCHIczjXruck9FdRpYrS4OgYMjWsRvC35ivB2csZYD MKn2DrUYWjISPK69Iz6nh9jvAMJb+kHY9bsheJ30= Date: Sun, 22 Mar 2020 21:16:19 -0700 From: Jaegeuk Kim To: Chao Yu Cc: Ju Hyung Park , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: Re: [PATCH v2] f2fs: use kmem_cache pool during inline xattr lookups Message-ID: <20200323041619.GD147648@google.com> References: <20200225101710.40123-1-yuchao0@huawei.com> <08d03473-9871-ba10-4626-58c4479ef9d1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08d03473-9871-ba10-4626-58c4479ef9d1@huawei.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/19, Chao Yu wrote: > Hi Ju Hyung, > > On 2020/3/18 20:14, Ju Hyung Park wrote: > > Hi Chao. > > > > I got the time around to test this patch. > > The v2 patch seems to work just fine, and the code looks good. > > Thanks a lot for the review and test. > > > > > On Tue, Feb 25, 2020 at 7:17 PM Chao Yu wrote: > >> diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c > >> index a3360a97e624..e46a10eb0e42 100644 > >> --- a/fs/f2fs/xattr.c > >> +++ b/fs/f2fs/xattr.c > >> @@ -23,6 +23,25 @@ > >> #include "xattr.h" > >> #include "segment.h" > >> > >> +static void *xattr_alloc(struct f2fs_sb_info *sbi, int size, bool *is_inline) > >> +{ > >> + *is_inline = (size == sbi->inline_xattr_slab_size); > > > > Would it be meaningless to change this to the following code? > > if (likely(size == sbi->inline_xattr_slab_size)) > > *is_inline = true; > > else > > *is_inline = false; > > Yup, I guess it's very rare that user will change inline xattr size via remount, > so I'm okay with this change. Applied like this. Thanks, 26 static void *xattr_alloc(struct f2fs_sb_info *sbi, int size, bool *is_inline) 27 { 28 if (likely(size == sbi->inline_xattr_slab_size)) { 29 *is_inline = true; 30 return kmem_cache_zalloc(sbi->inline_xattr_slab, GFP_NOFS); 31 } 32 *is_inline = false; 33 return f2fs_kzalloc(sbi, size, GFP_NOFS); 34 } > > Jaegeuk, > > Could you please help to update the patch in your git tree directly? > > Thanks, > > > > > The above statement seems to be only false during the initial mount > > and the rest(millions) seems to be always true. > > > > Thanks. > > . > >