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 DE017C00140 for ; Mon, 15 Aug 2022 03:22:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 41FF16B0073; Sun, 14 Aug 2022 23:22:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CFC68D0002; Sun, 14 Aug 2022 23:22:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 270506B0075; Sun, 14 Aug 2022 23:22:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 140E86B0073 for ; Sun, 14 Aug 2022 23:22:56 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D1F7F120D4A for ; Mon, 15 Aug 2022 03:22:55 +0000 (UTC) X-FDA: 79800380310.02.2CA1A90 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by imf23.hostedemail.com (Postfix) with ESMTP id 86D68140194 for ; Mon, 15 Aug 2022 03:22:54 +0000 (UTC) Received: by mail-pl1-f170.google.com with SMTP id w14so5391492plp.9 for ; Sun, 14 Aug 2022 20:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from:subject :user-agent:mime-version:date:message-id:from:to:cc; bh=MoHp3edTk60/FWLqry5Jc1cCYx2got+mqpDagtWO+Aw=; b=5lgLu4o7/5Ynp9XeO7kUlCa+14uOX8spr7MqkgcsUYjS2gjMOrFjNo1koiI7zdMXgY p3xeV4VuXOGGBjbKAwHQ8iUjnjgdiuYGTX4+U5BkPvtmx+lDX97OMx9gESa331NEYf8c SmRcQaJh7dipUtaZYmQPB8o1i17637SjC4Ib5uoLT7Yo0SqOmE49OPh5DY8fVzkYaYMF cgbvGQohVL/MLdseLRKefu0RUKDAFuyVmZNwXq2mJNrAC2debNN2trzdGHR06DYJEBOa fYi0zPY3iEFbImbuUYGP4GS+XGLfDk0OY+f0YqGMKcDN2n5RmhduCs/ledxIfD2E7jod CCHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc; bh=MoHp3edTk60/FWLqry5Jc1cCYx2got+mqpDagtWO+Aw=; b=eEgXOlVxBJewO7plkoFxqo/Q1WUBvNfIyyoLLjjXfA/ZMcBYhwyKuTBV3hVbKna5Zc Q/CdHOdB9rHWfTLJZOiNxVBaAjsS7fL5IScLUGHVjfXA2lXRkUiS94rFmRImzY8Se/Kh nz6Du/mXTAWum1vN25aULKpoSVfVCuYNGDdWQI3wkAgf2aM4iJZAfIBa0ES7VaTfiW+I Wd+xE1gXEKv+aE2ZH75TpjyP2PR1Un+3BKpcIFmI8SQ7v+PshHpwDfk3h09aGOb9w3Us mNj95HqA66ukt5MTCEUhkmbwDZDqs756bd/u1b6Ae/O0UszCqTftovLXDNxARxtiKjSR L9Qg== X-Gm-Message-State: ACgBeo2fBNMTSkQJ8FXOzmWGbbjb/8/LM8JcZhQn2F+XpVfFZ9IKrDF/ Lx7eAYPpruqBH90kA2AYg+aPnkbn48I2Gw== X-Google-Smtp-Source: AA6agR6NK+vqtBb4FwTqfZzuDxgaIHKMLt3yyjCR1skWNU8Hhz27P17CdyuoE0nvftJfBTisAcQP1g== X-Received: by 2002:a17:90b:38c6:b0:1f7:35d8:26e2 with SMTP id nn6-20020a17090b38c600b001f735d826e2mr26144044pjb.168.1660533773546; Sun, 14 Aug 2022 20:22:53 -0700 (PDT) Received: from [10.85.119.42] ([139.177.225.235]) by smtp.gmail.com with ESMTPSA id a22-20020aa795b6000000b0052dab7afa04sm5730635pfk.47.2022.08.14.20.22.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Aug 2022 20:22:53 -0700 (PDT) Message-ID: <61a5f144-0c9b-342b-865f-0c57a56e6d80@bytedance.com> Date: Mon, 15 Aug 2022 11:22:48 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v3] mm/compaction: fix set skip in fast_find_migrateblock From: Chuyi Zhou To: Andrew Morton , Mel Gorman Cc: linux-mm@kvack.org References: <20220713062009.597255-1-zhouchuyi@bytedance.com> <20220713082814.bed234e00d7f5ceb3858352a@linux-foundation.org> <20220714115020.GA3563@techsingularity.net> <3529e159-8c22-5d67-5e5d-c912784df9a0@bytedance.com> <20220719082854.GB3563@techsingularity.net> <20220814182407.5bc022265a66221de1796466@linux-foundation.org> <70a434b2-7f1c-7fad-a7b7-cb038a13fd2c@bytedance.com> In-Reply-To: <70a434b2-7f1c-7fad-a7b7-cb038a13fd2c@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660533775; a=rsa-sha256; cv=none; b=jSJuIf8yHtSNexlHR77yWLyrDg5s/ggLEmFHTjIZkZcg0KSHPTKMp2Vs2yt0vt9TzwM4q6 c0+cZIrk1Sa+sSTD8vkQnTv6cLd/NBEIkvNbdOvaMKlMWJ2ZWLWdmmrYO44q3Y3z5Z5JA2 17APV3ECO+n8PfJ2wuLlI//4T0DdHxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660533775; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MoHp3edTk60/FWLqry5Jc1cCYx2got+mqpDagtWO+Aw=; b=rpmHP0fvpiyuuQ1XN5VAAxN+Pz8rAd7/Pnfob7nMRB7DSETSVYYriYZOUqcDpmNHuR1lI7 5pPzJFJiilUYdBBeC3BtWKxrxb/vhAzgm+oto4M9VMC7dJhAZn6jsNEUC0Ihp9l6ZwLTiy wzSiuqAhHdSqMJqnC3knrMrFpXBLgpI= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=5lgLu4o7; spf=pass (imf23.hostedemail.com: domain of zhouchuyi@bytedance.com designates 209.85.214.170 as permitted sender) smtp.mailfrom=zhouchuyi@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: jckys6igogxbq73q4awfdi3d5gog99ph X-Rspamd-Queue-Id: 86D68140194 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=5lgLu4o7; spf=pass (imf23.hostedemail.com: domain of zhouchuyi@bytedance.com designates 209.85.214.170 as permitted sender) smtp.mailfrom=zhouchuyi@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1660533774-471903 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: 在 2022/8/15 上午11:20, Chuyi Zhou 写道: > > > 在 2022/8/15 上午9:24, Andrew Morton 写道: >> On Tue, 19 Jul 2022 09:28:54 +0100 Mel Gorman >> wrote: >> >>> The return block indeed may not be aligned. It could simply be a >>> restart. The changelog could still do with a little clarification but >>> your patch is still fine. >> >> I'm not seeing a v4 so I merged the v3.  It would be great if someone >> could please send along an updated changelog? > > Hi, Morton, Here is the updated changelog: > The fast_find_migrateblock could return a block aligned with > pageblock_nr_pages. When we successfully find a block, we use > pageblock_start_pfn(free_pfn) to get the first pfn of the pageblock, > the block will be set skip through *set_pageblock_skip*, normally > the value get from pageblock_start_pfn should be aligned with > *pageblock_nr_pages*. Then the *first pfn* will be passed to > isolate_migratepages_block, the whole pageblock will be skipped > due to the branch > if (!valid_page && IS_ALIGNED(low_pfn, pageblock_nr_pages)), because > !valid_page will be true for the first pageblock, and the low_pfn could > be aligned with pageblock_nr_pages as mentioned above. 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 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%* > > Fixes: 70b44595eafe9 ("mm, compaction: use free lists to quickly locate > a migration source") > Signed-off-by: zhouchuyi > ======================================================================= > Mel think it could be possible that the fast_find_migrateblock can return > a pageblock not aligned pageblock_nr_pages. In that case, > isolate_migratepages_block would not set skip flag. > I want to fix this problem in v4.