Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp754360rwd; Thu, 25 May 2023 03:32:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Jyp+//19Mez/dH221PiWAY52dTyLOGxuWseDZBZtkli5qGHaesLSbQtD1k841efmjBFXh X-Received: by 2002:a17:90a:b286:b0:250:b16:f498 with SMTP id c6-20020a17090ab28600b002500b16f498mr962215pjr.47.1685010774022; Thu, 25 May 2023 03:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685010774; cv=none; d=google.com; s=arc-20160816; b=1EqvIa74F/GznRgR5bX5Q7y1p/Fhdhqw6cvfgz5ow2MGUNS1JQhsyG0qAzuE7Nisab bLUpmwH1BB3bvT57U1IV6YCLWmVc/kDzy5L53zpdt5jPNNJJrs733CPI3SyFPm8RMFft W5rYyu6cg4g8k90L68e1BaqqsEArUn2ICjxEpPxRfkvlJntGXXOJfiwgxV/Dk3u78tle ThxoQXtmd/KitUnaihBltvY5ts5Ka49VxsOymCYxKeSsw/eTW+sEVSB/jO0qxBQb+Yza gmuMC6iLOGNYgwfJzvb5s9erXcaESakSth2vj3VTWjT8e0JiLjCTp+k8cN3gGDiycBbS XYlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=4GNSHGfIZxQ1UhhiGEkHCb26Lr2vl2sDD7sOPkyvdkU=; b=kNEgC1ELoGC7/AUxCIuWpOdyCRSkTQEoqtFaSugwCfb8As5mKUy7YlkkzbWkEQg2cV dDqaxV1ti/711urp6KtmijHCPuCDER741hAFDoqwdEVZzBcDN8DY38ca9rBgiQGiC5TC NtDiDuqPPPUbAcdJbb4kvPIwhra+JNYIE/qLnNovLWZZXnsXzaqSYOI34QHQRLP9H/Hh tNaYgE0rKA186DTkA/UTQUn2oEUvvF2dfrSqrCfM31ZPACr2Dbga6GRSxpy09JfShjXh 9W2zyglJx1mXQAmq9P6vXbvInBZflwue/g8JCEuh3tAfNPWmOhgIspXKTpxMan+pKegO WU2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=MZDYBRU9; dkim=neutral (no key) header.i=@suse.cz; 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 h64-20020a638343000000b0052868a865d4si844514pge.553.2023.05.25.03.32.39; Thu, 25 May 2023 03:32:53 -0700 (PDT) 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=@suse.cz header.s=susede2_rsa header.b=MZDYBRU9; dkim=neutral (no key) header.i=@suse.cz; 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 S240331AbjEYJ5Y (ORCPT + 99 others); Thu, 25 May 2023 05:57:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235941AbjEYJ5X (ORCPT ); Thu, 25 May 2023 05:57:23 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03AF1E42 for ; Thu, 25 May 2023 02:57:03 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3F9481FDEB; Thu, 25 May 2023 09:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1685008622; h=from:from:reply-to: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; bh=4GNSHGfIZxQ1UhhiGEkHCb26Lr2vl2sDD7sOPkyvdkU=; b=MZDYBRU9Bci0RIKRdZfhb12KZdd9o1+5028a4eYfDixTe4z1IdRWSXjk66QO6tzlNaulQy WZ1dBfkrIItBPmayNV/8uTD00kaoo20NBU8WkD1phAjgkj00Xdl7uTivdEejt7FHwMMCZp mVxs9mvTLhPm9+eWdNcEDUTZV59bBtc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1685008622; h=from:from:reply-to: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; bh=4GNSHGfIZxQ1UhhiGEkHCb26Lr2vl2sDD7sOPkyvdkU=; b=0t/2LQU/B8+fh1GulagPyChZ0uVz9Rj1PtNj04VJ1wXRvIb7YwU/hyR/vQYuKzI5gEJeTc ZL4xpARQQtIMHCBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1BEBE134B2; Thu, 25 May 2023 09:57:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 51s1Bu4wb2TzagAAMHmgww (envelope-from ); Thu, 25 May 2023 09:57:02 +0000 Message-ID: Date: Thu, 25 May 2023 11:57:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 1/4] mm: compaction: Ensure rescanning only happens on partially scanned pageblocks To: Mel Gorman Cc: Andrew Morton , Jiri Slaby , Maxim Levitsky , Michal Hocko , Pedro Falcato , Paolo Bonzini , Chuyi Zhou , Linux-MM , LKML References: <20230515113344.6869-1-mgorman@techsingularity.net> <20230515113344.6869-2-mgorman@techsingularity.net> Content-Language: en-US From: Vlastimil Babka In-Reply-To: <20230515113344.6869-2-mgorman@techsingularity.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 5/15/23 13:33, Mel Gorman wrote: > compact_zone() intends to rescan pageblocks if there is a failure to > migrate "within the current order-aligned block". However, the pageblock > scan may already be complete and moved to the next block causing the > next pageblock to be "rescanned". Ensure only the most recent pageblock > is rescanned. > > Reported-by: Vlastimil Babka > Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka > --- > mm/compaction.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/mm/compaction.c b/mm/compaction.c > index c8bcdea15f5f..81791c124bb8 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -2464,8 +2464,9 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) > * fast_find_migrateblock revisiting blocks that were > * recently partially scanned. > */ > - if (cc->direct_compaction && !cc->finish_pageblock && > - (cc->mode < MIGRATE_SYNC)) { > + if (!pageblock_aligned(cc->migrate_pfn) && > + cc->direct_compaction && !cc->finish_pageblock && > + (cc->mode < MIGRATE_SYNC)) { > cc->finish_pageblock = true; > > /*