Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6923881rwl; Fri, 30 Dec 2022 00:20:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXsKVkVXJEccFMgf9RhEpmQY/HDXria20RQkpb6xVhpe2oJ15QvPL0qQm06Ms1vctf+aphVV X-Received: by 2002:a62:b412:0:b0:581:3557:f75b with SMTP id h18-20020a62b412000000b005813557f75bmr15014742pfn.5.1672388426867; Fri, 30 Dec 2022 00:20:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672388426; cv=none; d=google.com; s=arc-20160816; b=cCDP1h4/UiKWyf+Wx7flUs3lCqerOWmzM5/PmFhVBlEhxWvojCQVX9EKSyxUQjIfCg RFH/o06LcXdofGogc9uoVUe3orC7ywOclFz2BUQQh34bJ+xMBCgOsAfAnHURHRjTfoJV SyqjOuAfntfBleMoL3X/C41kpyMiCEed2mVtB2mRmAJPXnFL/L6v2u/JfjWcMnSy/gWr pFEqCCd9PGukJGLIgQovk/dbaM4hPL8yyYjB6ddUmq1hUT2G8BpPkSQqPX1nx4XQUsVm 0zb0expVgQzIp7rvnVCaOFan/pzCTHsoqzKRrmUDMSb8gvWOuZVLWChCNWz9hfuMXN8k FRiQ== 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=wKcxZEuFQAuAVN1fDLHfDtQJh2W3Whfhs8zJpFzcCak=; b=g9mq4xOCQsmuR+w9ai9sQCeRw90XmOpG6AP6UEKdLt1s2n+KZQkWTqYC1LAMaDhBWI VAGYExdbIoZ208zUGSuzvw3RJZTJP7nsFRCbcgyYFOOhiB4rKcq1J5IYHyO1oVzBImDt 8tOEXUpBlcSKvI8+R7hHe2DT29etv/2PLyLQ8Ml+17oV43ltjaDBrNXD/H3Sw3MEzTFg i5kcBB0CLcSuv4OrFeZ8i6w6KyrspzTcIYRaiqBS0Nv/bUEv47LFhaO9bzYV0W5DsJ5w 68/Ep/ju7sro1tAlhLgGGg/75C6zzDsEi4NvpiY0JnisS9XD5rv0/hXr0jx9XrOrOl63 r53w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jETa2IMT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u34-20020a056a0009a200b00576a51119c0si22856099pfg.179.2022.12.30.00.20.18; Fri, 30 Dec 2022 00:20:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jETa2IMT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234727AbiL3IOl (ORCPT + 65 others); Fri, 30 Dec 2022 03:14:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234706AbiL3IOi (ORCPT ); Fri, 30 Dec 2022 03:14:38 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D69C5192B5 for ; Fri, 30 Dec 2022 00:14:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=wKcxZEuFQAuAVN1fDLHfDtQJh2W3Whfhs8zJpFzcCak=; b=jETa2IMTXRHLMYIFcEgHxbxej1 6upl737hSk1SkbOJmq4z/v+XT8Wbzj8iwsdp/ZHZBBfsrybBSuL1PxSea7MiUd34vTJE2sMu6pnMD WBLbw7arNFYYgCEx9UwyfuD4nMyzvGy5Z36FXeMERSRcEWUMshZ+34CEdlsBcqn9Tj2Ngzr8cTWpH EOvEC/T28uIAmY2BbQBNaBWA8QuXxdTdQ6yVHceT2MxAi69QzRvdYvyMDahCrAtLjSEuRq+MtrN66 YsNN/yjI64IfQ6dUbMDg5RL8/uNkKrL/vhrxMdSc0ELwdXjGN/JRs4xGi3Zp8s1/lS/w2XvsB9p+N QwxJJrdQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pBAXB-00ARil-UI; Fri, 30 Dec 2022 08:14:33 +0000 Date: Fri, 30 Dec 2022 08:14:33 +0000 From: Matthew Wilcox To: Kefeng Wang Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: huge_memory: convert split_huge_pages_all() to use a folio Message-ID: References: <20221229122503.149083-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221229122503.149083-1-wangkefeng.wang@huawei.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 29, 2022 at 08:25:03PM +0800, Kefeng Wang wrote: > - if (!PageHead(page) || PageHuge(page) || !PageLRU(page)) > + if (!folio_test_large(folio) > + || folio_test_hugetlb(folio) > + || !folio_test_lru(folio)) > goto next; That is a completely illegible way of indenting this code! There's no visual cue when the condition stops and when the next statement begins. Try one of these: if (!folio_test_large(folio) || folio_test_hugetlb(folio) || !folio_test_lru(folio)) goto next; if (!folio_test_large(folio) || folio_test_hugetlb(folio) || !folio_test_lru(folio)) goto next;