Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp744208rwd; Thu, 25 May 2023 03:22:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ50uv9F4up6H2UyUfXC5cg8EJaVzkNJ27yWtC1CIA60UcybCbYPwzkGBV2WTEQUAxsSmNWl X-Received: by 2002:a05:6a20:12c7:b0:10c:41a6:ac1f with SMTP id v7-20020a056a2012c700b0010c41a6ac1fmr12628418pzg.16.1685010122760; Thu, 25 May 2023 03:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685010122; cv=none; d=google.com; s=arc-20160816; b=snYV+StHWsp7pGEQOQ4a0DbTDfrtRs5C25aKk7DuGTlZF7V/owuTGZ9J6F/BY3kloz NHDDhvO0I/Oj7fRcBytTUbohYrxP87CRFYmO0lv2XUS7LC4Gxpx1dmGAUcyY/Vwv/HB7 nynv57/zYR479sSYO+WPUSTMpeQjjh3jZoZdnp2F5xeVjA2HkcEDsbTRbV1dZLDsw8cB /Vjb0dyjhITF8UFKGCaC+m/S+RntCkZn5ud20XJP0MVitjzffC88Y6YiwxnFAMdzpztf yerx+PXJgM4oWtKFxnzjOeZTX27BAX1BZLwWzNB5sJ1GUJHSwZdvW5mho1zVeIVxe30S YV9w== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=fcaGKeQO8rFxxr202sw2vP0gVAY2NAJ8aoAl4iO6eiI=; b=Vz/dlh9QRw44xXWFUg7fk5xovRiFQpbKgBcwgAyRc7VF9LpbYeTWUHgNm2vAW0fwiS GBBP+PEs6Dw0rwtNNB+9/OXdITC5LoCR2ZfPDw0NhCcIo6V+ZMCwsTOSRnhChRVVCL1l 0gHAWK9/Sh3QfzMp80FNg1QxSxLitEEAHjSD5MJ8BYa6kwHas0n1iDq6SQj+xwFo8D0y m2PtAdmZJQJwbu1mwczvDbYIFD7LKsDjYAUCfBEWoxiZukL+ubqb3Xk8hy25hovCE0jn RGA2C+RL0HrTG3wqCpyLpskyj33yOyD624G/cjXQGfni1M00OyBZ1vP0qInmWm+hFHz2 RUlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=uGYVCAfP; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=xHn03riz; 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 n17-20020a637211000000b0053045acfebdsi823751pgc.34.2023.05.25.03.21.50; Thu, 25 May 2023 03:22:02 -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=uGYVCAfP; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=xHn03riz; 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 S235071AbjEYKBX (ORCPT + 99 others); Thu, 25 May 2023 06:01:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232749AbjEYKBV (ORCPT ); Thu, 25 May 2023 06:01:21 -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 4D53BE7 for ; Thu, 25 May 2023 03:01:20 -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 0857C1FDFA; Thu, 25 May 2023 10:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1685008879; 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=fcaGKeQO8rFxxr202sw2vP0gVAY2NAJ8aoAl4iO6eiI=; b=uGYVCAfPehPquyJjUbhiNx6V2txpsmHSFI7n7xb3M5TKZNcnPJnKCNj49Qb0iJCBoeMyvd +4bFUtcHfKSo2Y96UG3nBtg5CYW0cd9XFMskVrzXKaWXLcXT3KUmYCI5DatMUnR+J/EXLP xUcxqL8nkaDDrzP1qbmZbzqvZf2z1Po= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1685008879; 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=fcaGKeQO8rFxxr202sw2vP0gVAY2NAJ8aoAl4iO6eiI=; b=xHn03rizVaTYNSQR8imtdC59I4GxgRM+Cy34s73SQeURU+gjTHropE/JX3tAmNFhBkD9Zl GproTgmgWXguoODg== 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 D8C85134B2; Thu, 25 May 2023 10:01:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ycNJNO4xb2S3bQAAMHmgww (envelope-from ); Thu, 25 May 2023 10:01:18 +0000 Message-ID: Date: Thu, 25 May 2023 12:01:18 +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 2/4] mm: compaction: Only force pageblock scan completion when skip hints are obeyed Content-Language: en-US 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-3-mgorman@techsingularity.net> From: Vlastimil Babka In-Reply-To: <20230515113344.6869-3-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: > fast_find_migrateblock relies on skip hints to avoid rescanning a recently > selected pageblock but compact_zone() only forces the pageblock scan > completion to set the skip hint if in direct compaction. While this > prevents direct compaction repeatedly scanning a subset of blocks due > to fast_find_migrateblock(), it does not prevent proactive compaction, > node compaction and kcompactd encountering the same problem described > in commit cfccd2e63e7e ("mm, compaction: finish pageblocks on complete > migration failure"). > > Force the scan completion of a pageblock to set the skip hint if skip > hints are obeyed to prevent fast_find_migrateblock() repeatedly selecting > a subset of pageblocks. > > Suggested-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 81791c124bb8..accc6568091a 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -2456,7 +2456,8 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) > } > /* > * If an ASYNC or SYNC_LIGHT fails to migrate a page > - * within the current order-aligned block, scan the > + * within the current order-aligned block and > + * fast_find_migrateblock may be used then scan the > * remainder of the pageblock. This will mark the > * pageblock "skip" to avoid rescanning in the near > * future. This will isolate more pages than necessary > @@ -2465,7 +2466,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) > * recently partially scanned. > */ > if (!pageblock_aligned(cc->migrate_pfn) && > - cc->direct_compaction && !cc->finish_pageblock && > + !cc->ignore_skip_hint && !cc->finish_pageblock && > (cc->mode < MIGRATE_SYNC)) { > cc->finish_pageblock = true; >