Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2342428rdb; Mon, 12 Feb 2024 01:14:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVnEy6WSaNn5rlCZNz3TkgZyXQxCWJ2SSKrXQQACyuBaJr0VBtDK+0FJMEw0ArV8+Wq9iSFzfVDGOB5B3FNPdftsudg9DLP9zgXvvtfuw== X-Google-Smtp-Source: AGHT+IF0JN72wrTd+3iLWW6TLd/WP6z4jXveEP+B1iCY21MQ7weur8P3aIhTeLGcNy9pNHUyrCBW X-Received: by 2002:a17:906:c8c3:b0:a38:6d3:ac54 with SMTP id gc3-20020a170906c8c300b00a3806d3ac54mr4584330ejb.23.1707729248564; Mon, 12 Feb 2024 01:14:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707729248; cv=pass; d=google.com; s=arc-20160816; b=WmBQnG86M0HdEVloRp8piOqeRtYu/Xt07kZeNkhbR0pkxIJNDTJNDWEbymR1y85v2O G2HMZGYHbRGpFkPnrb9d3EpiXIaxmHdlmm9JuqxssypMX0FThy4itqvxOaThgRO4o7TC /EbMG+aHeh4x7nUxq07v2LLwNB5hEKqlgXmXlYSbiQZjXK+2YdOXmo3/Ci6TyTm0B+LJ TlQkStJ3yYDB1MoiPalGzK5Kuz9lqCRDcUszH8gCq9bm7eN/x+VSU34pnvaAI2dL3RBP FD7PFqBVKg0ILZRR5l4VsLzO9dPzJqsQTUzmVeCCRiCS2zMtMh/ahrTwn/XsPwe/s1q9 qebg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=6k7i6PGa+VnvHSMu8tCjQ92uFfMIfah6CK1ZLbbSmS4=; fh=82Oe3+q/Pk+r/P7ALk+PLapf+Wc/SVSYiZI4eqjTz3k=; b=DPjsxmTQi7hKOJoNu8v9N6cIVpgXoCsauTdHgQzN9QROPWsDamvF3pt2ilmhuK1d15 IQa4s6FrkEwTzK6w0655ublw04ag449POpkDHlXFqJ0LlW3QInY0WNbVTOgGZyvcbpfb ydt896q52Hp0E3HlnDZmet4qNhlKSU6WNakQNMWtLYE6k7GWvUt+H+juBaHNwLZbfk0x W4u6oGQ5X81qyzkuXHrpfIZUKc2OpAHOQBttypiiPS7vtmP1Fv7ZKLKQ67ncj+Ue60/u tjl87I6/Y6OI3Ad/8F56mi5enuoA2oWeAYnC0C9ob065ozPkx8sb2T8dqb/uLDikPJhf tLow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=NgfR+j9x; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=NgfR+j9x; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-61234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61234-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWs/09K9AOnJirdVgTVLvqoXvfHPFustwGgbt9c+u+8Vqu1owkoROG4FiU0Lx9fouWYPF/bAZqiME8Fhpqo5QFj5idp5QQF72055OC+bA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lf14-20020a170907174e00b00a37c6f954f2si3591938ejc.783.2024.02.12.01.14.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 01:14:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=NgfR+j9x; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=NgfR+j9x; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-61234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61234-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 22B381F22714 for ; Mon, 12 Feb 2024 09:14:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A3B3101EB; Mon, 12 Feb 2024 09:14:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="NgfR+j9x"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="FH/Sng6q"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="NgfR+j9x"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="FH/Sng6q" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 835BAF51F for ; Mon, 12 Feb 2024 09:13:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707729240; cv=none; b=I7FgTJDlwz9h3d69gpQo9R47Ij65KI4CIQb5dhUng7U9lYlwmCsJK96KYJjWH5V7xym5apOdIa3MWLAm5T5uu+H6DZibwP2T+koByK5iQiD/eTdJh8ybNyKDJ5B/kB0macQZUy3QbXlopdrTsxEHJEwWQ78ayNhKfQ8GEjIKf84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707729240; c=relaxed/simple; bh=rTWYqHYDvRBI+DRk+/jbNPaRiHUGi114yRDzDzEcEGA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=l99hE6E8PdPCw0VO3S9WMtlSOBzaWqySb4gmzTXyaduT61jcGbDULMv0dYyszcXuwCiG7y2jJIuR9PdqNVj3hQmLxAqD/b/9Hr3ZIYPhHDG/unz/NaEf5uxJYFupKHdnNDAYjDG5xVKKTx2y77kPo3YxVac+vSAtsYPiP2fEOlM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=NgfR+j9x; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=FH/Sng6q; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=NgfR+j9x; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=FH/Sng6q; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AB3BE1F457; Mon, 12 Feb 2024 09:13:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1707729236; 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=6k7i6PGa+VnvHSMu8tCjQ92uFfMIfah6CK1ZLbbSmS4=; b=NgfR+j9xubFTcy1K7ELHQreF1nqp4lamsgMhZi1WzxrtIp4/I+alUp9zjnU1dY5xGqS3s2 8iw6Bh0D59zu762v4lLbaAEyTsSBaLw1kAgPwSQ2rRHG9SdZy8LmTZk2QpevzCw05e9mRs qmX8WwgZfoJADBsK8ViP2awJyM7oguQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1707729236; 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=6k7i6PGa+VnvHSMu8tCjQ92uFfMIfah6CK1ZLbbSmS4=; b=FH/Sng6qg2TlRjvFOYv4avzy+EfNrg9Kqg7Bd3zVhiK45GyHfeAOBKkZtnnG2gFvMUWCtj xR1IF2wGlR8QxSBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1707729236; 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=6k7i6PGa+VnvHSMu8tCjQ92uFfMIfah6CK1ZLbbSmS4=; b=NgfR+j9xubFTcy1K7ELHQreF1nqp4lamsgMhZi1WzxrtIp4/I+alUp9zjnU1dY5xGqS3s2 8iw6Bh0D59zu762v4lLbaAEyTsSBaLw1kAgPwSQ2rRHG9SdZy8LmTZk2QpevzCw05e9mRs qmX8WwgZfoJADBsK8ViP2awJyM7oguQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1707729236; 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=6k7i6PGa+VnvHSMu8tCjQ92uFfMIfah6CK1ZLbbSmS4=; b=FH/Sng6qg2TlRjvFOYv4avzy+EfNrg9Kqg7Bd3zVhiK45GyHfeAOBKkZtnnG2gFvMUWCtj xR1IF2wGlR8QxSBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9A84A13985; Mon, 12 Feb 2024 09:13:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id arJhJVThyWWQfgAAD6G6ig (envelope-from ); Mon, 12 Feb 2024 09:13:56 +0000 Message-ID: <20c8fa7c-62ae-4e48-aaec-8b512519cee9@suse.cz> Date: Mon, 12 Feb 2024 10:13:56 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] mm: compaction: limit the suitable target page order to be less than cc->order To: Baolin Wang , akpm@linux-foundation.org, Zi Yan Cc: mgorman@techsingularity.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: Content-Language: en-US From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-0.09 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -0.09 On 1/22/24 14:01, Baolin Wang wrote: > It can not improve the fragmentation if we isolate the target free pages > exceeding cc->order, especially when the cc->order is less than pageblock_order. > For example, suppose the pageblock_order is MAX_ORDER (size is 4M) and cc->order > is 2M THP size, we should not isolate other 2M free pages to be the migration > target, which can not improve the fragmentation. > > Moreover this is also applicable for large folio compaction. So why not Cc: Zi Yan? (done) > Signed-off-by: Baolin Wang I doubt this will make much difference, because if such a larger order free page exists, we shouldn't have a reason to be compacting for a lower order in the first place? > --- > mm/compaction.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/mm/compaction.c b/mm/compaction.c > index 27ada42924d5..066b72b3471a 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -1346,12 +1346,14 @@ static bool suitable_migration_target(struct compact_control *cc, > { > /* If the page is a large free page, then disallow migration */ > if (PageBuddy(page)) { > + int order = cc->order > 0 ? cc->order : pageblock_order; > + > /* > * We are checking page_order without zone->lock taken. But > * the only small danger is that we skip a potentially suitable > * pageblock, so it's not worth to check order for valid range. > */ > - if (buddy_order_unsafe(page) >= pageblock_order) > + if (buddy_order_unsafe(page) >= order) > return false; > } >