Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3484207rdb; Wed, 13 Sep 2023 13:32:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFETujUh10m3FTZKIDD0tcfin4Nm64E4X95WZtFAq6lKu4f12971Tkh9hUM0ZjqQebPRwQY X-Received: by 2002:a05:6a20:3d1d:b0:14c:5dc2:650c with SMTP id y29-20020a056a203d1d00b0014c5dc2650cmr4006984pzi.40.1694637125850; Wed, 13 Sep 2023 13:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694637125; cv=none; d=google.com; s=arc-20160816; b=CJANAqLJLg6VJbPDia+bc7fowi8Vhxvs9D4cUVreJURA6ZFade7tioc2myHD2Ty1ZW rsdmgLAcxxk4qVdcSX28ItHiF4WLVGC+RkiyUSBh/BY5DL6bphK1Au6nZ7a1i8NXQ82d Wl8NFvROVTQgxWGo/HAhAT7sm7y2yfbcmHPcAWy80EN1zfvxxsp7PbNUeRfvYX2hKxK1 vfSAU05BZf3qxdqS7P8FpyMYRm3G+0RaRggc021wWzGWzrYfYHEg0bM5xJhbPqr91fwg fxudBZm2HFhPmSN7Xoir2p4YOFH+sa+e9ERpDl2u1ZeJP4wg/97JzgDBi/Y6mJFYUh0p 5Pbg== 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=EY/TxriRyLcQRT/QMGb4HpluzBBUSCH2N2LP0RzmfO8=; fh=hq15/A2Tslw9YA2204Su5Ecu43xpuzUCtL6/M8x+dIs=; b=NmsqPtZ2+8d35Dr3X0JBCQbLisi0CdOf4BC7tnXlyzCAFqOhhNHG/49gSd8G26u9KK y82bT08JIH8NY3Ht180hbIeWh9p3rbV7h4i7o5kb1BZC8dtDKELX+VG9zuov+ern1h/U ojQz38t6gwfV0ELAS0fOjkz8bzQ5AEGB25lmxnrQiisxo90MFtvAbrErNK8npBsSp2xk HMiLvqhYSu6DEfcikbDcHsNyBv/J4T4jFDqA5AbZTfWLTsumJJKon799srt++Fa3LIx2 2elEFrraqIJW3cWl9qMeqH+FP5I1GhAkRahSll3S5ZzrdIFFWDAdm2dAHZdaDNgyCMec YCDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=NeoBvf5V; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="otSpZk/6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id cw13-20020a056a00450d00b0068fcb4cb09bsi8122pfb.30.2023.09.13.13.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 13:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=NeoBvf5V; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="otSpZk/6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4C35A807C74F; Wed, 13 Sep 2023 07:31:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241065AbjIMObV (ORCPT + 99 others); Wed, 13 Sep 2023 10:31:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240574AbjIMObV (ORCPT ); Wed, 13 Sep 2023 10:31:21 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C32679B for ; Wed, 13 Sep 2023 07:31:16 -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-out1.suse.de (Postfix) with ESMTPS id 67772218EC; Wed, 13 Sep 2023 14:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1694615475; 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=EY/TxriRyLcQRT/QMGb4HpluzBBUSCH2N2LP0RzmfO8=; b=NeoBvf5VsVcl9T2Kn2QDODTiiC7qSnHJx+vjBBavdg/eaixbkUXEyz7gvKNUoP0mT2Pz9R t5sej4mVeuZzT2wEbYDB3CaxQLw7c1mFuTqal6sojjcFlUbWPOhHmj7UDZxSXM+nwTeLB1 34ksygCii9pbj8b7VG2iXea8MxacYJ4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1694615475; 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=EY/TxriRyLcQRT/QMGb4HpluzBBUSCH2N2LP0RzmfO8=; b=otSpZk/66fLfB3CFnrVlBquoqW6KRhdLNyBirtLyf/jREhi1uEp8DdaQjY11JfLOcSxy9U ADnCwyuUgNT3SXBA== 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 4425813582; Wed, 13 Sep 2023 14:31:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id JpOOD7PHAWX0ZAAAMHmgww (envelope-from ); Wed, 13 Sep 2023 14:31:15 +0000 Message-ID: Date: Wed, 13 Sep 2023 16:31:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH 3/6] mm: page_alloc: move free pages when converting block during isolation Content-Language: en-US To: Johannes Weiner , Andrew Morton Cc: Mel Gorman , Miaohe Lin , Kefeng Wang , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20230911195023.247694-1-hannes@cmpxchg.org> <20230911195023.247694-4-hannes@cmpxchg.org> From: Vlastimil Babka In-Reply-To: <20230911195023.247694-4-hannes@cmpxchg.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Sep 2023 07:31:27 -0700 (PDT) X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email On 9/11/23 21:41, Johannes Weiner wrote: > When claiming a block during compaction isolation, move any remaining > free pages to the correct freelists as well, instead of stranding them > on the wrong list. Otherwise, this encourages incompatible page mixing > down the line, and thus long-term fragmentation. > > Signed-off-by: Johannes Weiner Reviewed-by: Vlastimil Babka > --- > mm/page_alloc.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 3db405414174..f6f658c3d394 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2548,9 +2548,12 @@ int __isolate_free_page(struct page *page, unsigned int order) > * Only change normal pageblocks (i.e., they can merge > * with others) > */ > - if (migratetype_is_mergeable(mt)) > + if (migratetype_is_mergeable(mt)) { > set_pageblock_migratetype(page, > MIGRATE_MOVABLE); > + move_freepages_block(zone, page, > + MIGRATE_MOVABLE, NULL); > + } > } > } >