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 2750DC4829B for ; Mon, 12 Feb 2024 09:14:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 912486B0071; Mon, 12 Feb 2024 04:14:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C1496B0075; Mon, 12 Feb 2024 04:14:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 763256B0078; Mon, 12 Feb 2024 04:14:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 67F056B0071 for ; Mon, 12 Feb 2024 04:14:01 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3BC7BA1C4A for ; Mon, 12 Feb 2024 09:14:01 +0000 (UTC) X-FDA: 81782589882.09.DEE62D8 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf13.hostedemail.com (Postfix) with ESMTP id 9E4B320019 for ; Mon, 12 Feb 2024 09:13:58 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NgfR+j9x; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="FH/Sng6q"; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NgfR+j9x; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="FH/Sng6q"; dmarc=none; spf=pass (imf13.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707729239; a=rsa-sha256; cv=none; b=q0WSX4yeF9yeimxsqaek1nIqgNPqZn3SzcLZpb6A4W2/hWm08e+fnkDwbTKlo9UkfpchE7 R1knsdU3d5qqbXxPC0hI/RQXvzFebAgMX4NTXlsToT5Rf7TIOVaiGIv1e2WJtri6MYSBM/ EWoPYfQp/Dptp4IsmvJr8lz7dBBkjKE= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NgfR+j9x; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="FH/Sng6q"; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NgfR+j9x; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="FH/Sng6q"; dmarc=none; spf=pass (imf13.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707729239; 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=6k7i6PGa+VnvHSMu8tCjQ92uFfMIfah6CK1ZLbbSmS4=; b=aSad6HZiNEvLYUSjyck0cqYN8l+OmYQrgy/x+NjRbNzS4QVl3m39qSyzlpEjVZHiJ7+hLd Zg/rtQFFpjt0FSrSft9Al/IAV4PszJZoxB0C/e6qIbhRwv7+//zC0z/A1nZEm8nKQJuPCq uK95B7Dnf26bKP1OGbGUzHtCI42EiO4= 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 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 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9E4B320019 X-Stat-Signature: h3rk8bdp6qjbckf9mpykegcs5n5dpnaa X-HE-Tag: 1707729238-931648 X-HE-Meta: U2FsdGVkX19+mbuFzJfSznF2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XR7zMAr8UNAg7B72QBS+S9TN/igEYCu3aV6VS7Hvt19f4h807/BZpYHYGfiXZlNZWE0o77CR+bEWrMVdUzH88/p2/b+Gz7HetvpHKuBH3e7y9+qKMt/7FZydG5FqKTsmyRiFR5ayhxDFvmnnPp2fLU/d4YZ1dh1uQ+DqyOUFDfK22FonwETw 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: List-Subscribe: List-Unsubscribe: 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; > } >