From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30A28C00454 for ; Wed, 11 Dec 2019 14:41:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 019122465C for ; Wed, 11 Dec 2019 14:41:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=aol.com header.i=@aol.com header.b="fsjcTIV9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729946AbfLKOl0 (ORCPT ); Wed, 11 Dec 2019 09:41:26 -0500 Received: from sonic316-54.consmr.mail.gq1.yahoo.com ([98.137.69.30]:46287 "EHLO sonic316-54.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730010AbfLKOlZ (ORCPT ); Wed, 11 Dec 2019 09:41:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1576075283; bh=8NXnEgzl9Hn8ih6NVxBSO6w7sunPtWemBcwEu/MIQmY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=fsjcTIV9H5UBmlvgJKstt4aT/VgsSf7yCPzptrD0iuurqBijQPf9SpJnVFK30s2Ycx6WiiJ5vWb5xaNBaudYrK5FVORUy9y1N6Lq4pbRgfipFlGZLv6/tinLBRT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qO3rtnmsGO45TPuMMTOrdQNBVQB.H62evznpNyGJgpr5btZicu4VYFtWFySdrSPrQ2sZmBFPPX txqmSEGEm8GyzRCsSMWyvset0sc50Kc3SOTFcsAwtlinDM55dJjAd3Sht3mAF49ttU27GypPpFUP 6SzBMznAm6FS6EUxwy4PlXc1HPvF6HkXiffyCsthLUMy0WHG48OYxXeAgl2H1G.d5tqyYbwsNn7W FjS9MKf12dXY8FzTo32qAK_0Ng8M9GXVUdvsdb0I7pECxp5aCvEsVbt7FItG4HMBS8ztJPYZ54bE p2uwf.B1hmfnt87hZfIkVw3r4m8OXYszcbUqsHX3WhM.BrghCdqycqzRu8O8jJu2fsuSdFx_hWV6 MMhCq72YiZxrk5xuN7XJeo.18JqmD0l66geIQWB38WxgtbOTN1xfgchBgzW.Bh_QC5Bqlgs.OBQr Ia_BVgCLitKrmkzLIiz9p4trv8BhmG2JQ7291iwAdXwRoFB5MgE4ohNYRsGpcSDDE8hgmWkQJqvB 6_qUOovThV5EDGgwha5sBn8uY9VkIK.irycx0ed_u0gv7ilE_lZPAm9v8iexz5HMXgN4B3vwhHSW E Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Wed, 11 Dec 2019 14:41:23 +0000 Received: by smtp417.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 36f5534268c63ff9379ab7e119e12b1f; Wed, 11 Dec 2019 14:41:18 +0000 (UTC) Date: Wed, 11 Dec 2019 22:41:00 +0800 From: Gao Xiang To: Matthew Wilcox Cc: Gao Xiang , Tiezhu Yang , Al Viro , Eric Biggers , "Theodore Y. Ts'o" , Jaegeuk Kim , Chao Yu , Tyler Hicks , linux-fsdevel@vger.kernel.org, ecryptfs@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, "Darrick J. Wong" Subject: Re: [PATCH v5] fs: introduce is_dot_or_dotdot helper for cleanup Message-ID: <20191211144055.GA6951@hsiangkao-HP-ZHAN-66-Pro-G1> References: <1576030801-8609-1-git-send-email-yangtiezhu@loongson.cn> <20191211024858.GB732@sol.localdomain> <20191211044723.GC4203@ZenIV.linux.org.uk> <4a90aaa9-18c8-f0a7-19e4-1c5bd5915a28@loongson.cn> <20191211071711.GA231266@architecture4> <20191211134014.GM32169@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191211134014.GM32169@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Mailer: WebService/1.1.14728 hermes Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_181) Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org Hi Matthew, On Wed, Dec 11, 2019 at 05:40:14AM -0800, Matthew Wilcox wrote: > On Wed, Dec 11, 2019 at 03:17:11PM +0800, Gao Xiang wrote: > > > static inline bool is_dot_or_dotdot(const unsigned char *name, size_t len) > > > { > > > if (len >= 1 && unlikely(name[0] == '.')) { > > > > > > And I suggest drop "unlikely" here since files start with prefix > > '.' (plus specical ".", "..") are not as uncommon as you expected... > > They absolutely are uncommon. Even if you just consider > /home/willy/kernel/linux/.git/config, only one of those six path elements > starts with a '.'. Okay, I think it depends on userdata and access patterns. I admit I have no statistics on all those callers. Just considering introducing an inline helper for cleanup, except for lookup_one_len_common() (since it's on an error path), others were all without unlikely() before. Ignore my words if it seems unreasonable or unlikely() is an improvement in this patch and sorry for annoying. Thanks, Gao Xiang From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31D38C2D0C6 for ; Wed, 11 Dec 2019 14:41:34 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F20E52173E; Wed, 11 Dec 2019 14:41:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.sourceforge.net header.i=@lists.sourceforge.net header.b="GA6B6h6h"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="abJGbIQK"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="HcRh1Ob5"; dkim=neutral (0-bit key) header.d=aol.com header.i=@aol.com header.b="fsjcTIV9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F20E52173E Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=lists.sourceforge.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:In-Reply-To:MIME-Version:References: Message-ID:To:Date:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HBiqgRExdgcR85kjCtFHvyd/ybIgfoYeWn7F8hhh+eU=; b=GA6B6h6h+Ay5Z31CYwrv0umW1 gSN81XFPUppdIo0/4Tx48dGrN9mr3Fr1STMx2RzJMLxSjPNrmOADkiX3b4nELoI9RO9WixXZLYIp+ 98GE96tSwIdxuqHObtu9orcYPQ5QUGz7z7K4TuF2I6VUDm4I/9tialh3VsIKN9JKPSJ7c=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1if3BF-0003f4-7X; Wed, 11 Dec 2019 14:41:33 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1if3BD-0003ew-L5 for linux-f2fs-devel@lists.sourceforge.net; Wed, 11 Dec 2019 14:41:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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=8NXnEgzl9Hn8ih6NVxBSO6w7sunPtWemBcwEu/MIQmY=; b=abJGbIQKQCeURwVXek3G+opl00 pNXtVT6SDy1LZb99u6Lw0hSmrVx/YcLDUrBPZPWieE4lkrGlij4aObW52o9FvI48+sP5rgFajcf+q S8Pi8g3CqJySQDmxW3apEGSZTwj5NfqlB9w8+vvDj8fKXEZNIPqx1XlQMd54RYV5G/JE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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=8NXnEgzl9Hn8ih6NVxBSO6w7sunPtWemBcwEu/MIQmY=; b=HcRh1Ob5QeP2g6/xKcY/wmJdnN sO3zZbsXZt/Z9PUyd+c6TIorrXOtpxH/9mNmuuaKnfsK18070Jg6+hEG5CahYI6EgxIQ5wXIVApzL K87bTzDIBLAG4GkrJ1pT0lfuMgT4kMbAsQzkLSh26NHA1Rl6wC/rC+8/eOojhS+B9YAA=; Received: from sonic316-54.consmr.mail.gq1.yahoo.com ([98.137.69.30]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1if3BB-0010St-Im for linux-f2fs-devel@lists.sourceforge.net; Wed, 11 Dec 2019 14:41:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1576075283; bh=8NXnEgzl9Hn8ih6NVxBSO6w7sunPtWemBcwEu/MIQmY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=fsjcTIV9H5UBmlvgJKstt4aT/VgsSf7yCPzptrD0iuurqBijQPf9SpJnVFK30s2Ycx6WiiJ5vWb5xaNBaudYrK5FVORUy9y1N6Lq4pbRgfipFlGZLv6/tinLBRT9cWbuOkykanIr1jciUbo0mLN5d3UnwaJH6qCatvgK3tFU7AEnUxbBXXFBKdCLSGYVK6KAEJbeQPjSDOKv9Bb3ieEF/UcWl9axO8JI8thuE5nKudgH5053ddxAM2nDZvmSdNqK0B2hE24QgdCm8yASCFVItBXYHNvoPk8ssysD75q/fd6xZm10G0UVccXuCqvnk1TCLDHhSg3msuFeLNd5TBz2tw== X-YMail-OSG: 7tLwCK8VM1kVE8ixC98XdwHbsJrsuowK0Ze0yHbgVvZa6ezhc58f6EXGiUYOjUo AvgARQgxWpqLV1OAf3D2fl_5DMhgK5Ev.ttEquU_oV7eCokz3DaqY_Qu0WCyuDh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jJu2fsuSdFx_hWV6 MMhCq72YiZxrk5xuN7XJeo.18JqmD0l66geIQWB38WxgtbOTN1xfgchBgzW.Bh_QC5Bqlgs.OBQr Ia_BVgCLitKrmkzLIiz9p4trv8BhmG2JQ7291iwAdXwRoFB5MgE4ohNYRsGpcSDDE8hgmWkQJqvB 6_qUOovThV5EDGgwha5sBn8uY9VkIK.irycx0ed_u0gv7ilE_lZPAm9v8iexz5HMXgN4B3vwhHSW E Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Wed, 11 Dec 2019 14:41:23 +0000 Received: by smtp417.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 36f5534268c63ff9379ab7e119e12b1f; Wed, 11 Dec 2019 14:41:18 +0000 (UTC) Date: Wed, 11 Dec 2019 22:41:00 +0800 To: Matthew Wilcox Message-ID: <20191211144055.GA6951@hsiangkao-HP-ZHAN-66-Pro-G1> References: <1576030801-8609-1-git-send-email-yangtiezhu@loongson.cn> <20191211024858.GB732@sol.localdomain> <20191211044723.GC4203@ZenIV.linux.org.uk> <4a90aaa9-18c8-f0a7-19e4-1c5bd5915a28@loongson.cn> <20191211071711.GA231266@architecture4> <20191211134014.GM32169@bombadil.infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191211134014.GM32169@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Mailer: WebService/1.1.14728 hermes Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_181) X-Headers-End: 1if3BB-0010St-Im Subject: Re: [f2fs-dev] [PATCH v5] fs: introduce is_dot_or_dotdot helper for cleanup X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Gao Xiang via Linux-f2fs-devel Reply-To: Gao Xiang Cc: ecryptfs@vger.kernel.org, "Theodore Y. Ts'o" , "Darrick J. Wong" , linux-kernel@vger.kernel.org, Tyler Hicks , Eric Biggers , linux-fscrypt@vger.kernel.org, Al Viro , Jaegeuk Kim , linux-fsdevel@vger.kernel.org, Tiezhu Yang , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Hi Matthew, On Wed, Dec 11, 2019 at 05:40:14AM -0800, Matthew Wilcox wrote: > On Wed, Dec 11, 2019 at 03:17:11PM +0800, Gao Xiang wrote: > > > static inline bool is_dot_or_dotdot(const unsigned char *name, size_t len) > > > { > > > if (len >= 1 && unlikely(name[0] == '.')) { > > > > > > And I suggest drop "unlikely" here since files start with prefix > > '.' (plus specical ".", "..") are not as uncommon as you expected... > > They absolutely are uncommon. Even if you just consider > /home/willy/kernel/linux/.git/config, only one of those six path elements > starts with a '.'. Okay, I think it depends on userdata and access patterns. I admit I have no statistics on all those callers. Just considering introducing an inline helper for cleanup, except for lookup_one_len_common() (since it's on an error path), others were all without unlikely() before. Ignore my words if it seems unreasonable or unlikely() is an improvement in this patch and sorry for annoying. Thanks, Gao Xiang _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel