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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC06DC43334 for ; Wed, 13 Jul 2022 02:23:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 402019400F5; Tue, 12 Jul 2022 22:23:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B1DC9400E5; Tue, 12 Jul 2022 22:23:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A1D69400F5; Tue, 12 Jul 2022 22:23:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 16E119400E5 for ; Tue, 12 Jul 2022 22:23:57 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DD203342EF for ; Wed, 13 Jul 2022 02:23:56 +0000 (UTC) X-FDA: 79680481272.15.712E88C Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf18.hostedemail.com (Postfix) with ESMTP id 9B4951C0072 for ; Wed, 13 Jul 2022 02:23:55 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LjLwB6m2xzkWw6; Wed, 13 Jul 2022 10:21:30 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 13 Jul 2022 10:23:09 +0800 Subject: Re: [PATCH v2] mm/compaction: fix set skip in fast_find_migrateblock To: Zhou Chuyi , References: <20220712072745.33870-1-zhouchuyi@bytedance.com> From: Miaohe Lin Message-ID: Date: Wed, 13 Jul 2022 10:23:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20220712072745.33870-1-zhouchuyi@bytedance.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657679036; a=rsa-sha256; cv=none; b=Xzd05kXhTguMQ6UIeQZ06NDOZVjRjys8yAWKYHjHqebKPnJcXhkrPa321EgIzmqVrEeljl wZBk9R8QKlGjo+Ag3tHdFj44bva6jZsUNNRztzTHp6DGAwKOsW0Mylu07e9k7CSjOvuNPn 0OTrbbYbQ+hiMRf75EQv3mesuzASNJU= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657679036; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OSKLBWVfdV5mMhf8vSx087zLwotaPLFpZIMN1XxxWyE=; b=sGMoMXHNyKlEblDLAb8Z+PdA/4LPLTRMz4771vprgay2yE0StPPXZ5m7zpXlQJ1TLBo7Ok R4WDzmEIPTOcnDBo0zHp8dToD0Pf6t/FFg3MUuF69CSpeoU51cAsT9rhCzHwS/iV5rc57i gvVREPLTKtaphI+Nv6mVTLJA4CO5ML8= X-Rspamd-Queue-Id: 9B4951C0072 Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam02 X-Rspam-User: X-Stat-Signature: 5ma5iapne7o9sji4wxo7f4oysbg86gdk X-HE-Tag: 1657679035-72072 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2022/7/12 15:27, Zhou Chuyi wrote: > From: zhouchuyi > > When we successfully find a pageblock in > fast_find_migrateblock(), the block will be set > skip-flag through set_pageblock_skip(). > However, when entering isolate_migratepages_block(), > the whole pageblock will be skipped due to the branch > 'if (!valid_page && IS_ALIGNED(low_pfn, pageblock_nr_pages))'. > Eventually we will goto isolate_abort and isolate nothing. > That cause fast_find_migrateblock useless. > > In this Patch, when we find a suitable pageblock in > fast_find_migrateblock, we do noting but let > isolate_migratepages_block to set skip flag to > the pageblock after scan it. Normally, we would > isolate some pages from the fast-find block. > > I use mmtest/thpscale-madvhugepage test it. Here > is the result: > baseline patch > Amean fault-both-1 1331.66 ( 0.00%) 1261.04 * 5.30%* > Amean fault-both-3 1383.95 ( 0.00%) 1191.69 * 13.89%* > Amean fault-both-5 1568.13 ( 0.00%) 1445.20 * 7.84%* > Amean fault-both-7 1819.62 ( 0.00%) 1555.13 * 14.54%* > Amean fault-both-12 1106.96 ( 0.00%) 1149.43 * -3.84%* > Amean fault-both-18 2196.93 ( 0.00%) 1875.77 * 14.62%* > Amean fault-both-24 2642.69 ( 0.00%) 2671.21 * -1.08%* > Amean fault-both-30 2901.89 ( 0.00%) 2857.32 * 1.54%* > Amean fault-both-32 3747.00 ( 0.00%) 3479.23 * 7.15%* > > Fixs: 'commit 70b44595eafe9 ("mm, compaction: use free lists > to quickly locate a migration source")' Thanks for your patch. Yet something to improve: ./scripts/checkpatch.pl v2-mm-compaction-fix-set-skip-in-fast_find_migrateblock.patch ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("")' - ie: 'commit 70b44595eafe ("mm, compaction: use free lists to quickly locate a migration source")' #101: Fixs: 'commit 70b44595eafe9 ("mm, compaction: use free lists to quickly locate a migration source")' total: 1 errors, 0 warnings, 7 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. [PATCH v2] mm_compaction fix set skip in fast_find_migrateblock.eml has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. And remember runing get_maintainer.pl to get the right people before sending the patch: ./scripts/get_maintainer.pl v2-mm-compaction-fix-set-skip-in-fast_find_migrateblock.patch Andrew Morton <akpm@linux-foundation.org> (maintainer:MEMORY MANAGEMENT) linux-mm@kvack.org (open list:MEMORY MANAGEMENT) linux-kernel@vger.kernel.org (open list) BTW: It's not enforced but ~70 chars per line in commit log might be preferred. > > Signed-off-by: zhouchuyi <zhouchuyi@bytedance.com> Thanks. > --- > mm/compaction.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/mm/compaction.c b/mm/compaction.c > index 1f89b969c..a1a2b50c8 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -1852,7 +1852,6 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc) > pfn = cc->zone->zone_start_pfn; > cc->fast_search_fail = 0; > found_block = true; > - set_pageblock_skip(freepage); > break; > } > } >