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 460B5E74AC4 for ; Tue, 3 Dec 2024 16:53:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0EEA6B0085; Tue, 3 Dec 2024 11:53:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ABE546B0088; Tue, 3 Dec 2024 11:53:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96AAA6B008A; Tue, 3 Dec 2024 11:53:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 7352B6B0085 for ; Tue, 3 Dec 2024 11:53:19 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EBFC81C72CE for ; Tue, 3 Dec 2024 16:53:18 +0000 (UTC) X-FDA: 82854242898.12.7699E32 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf08.hostedemail.com (Postfix) with ESMTP id 5BF6A160011 for ; Tue, 3 Dec 2024 16:53:07 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=eYxNhogp; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=x6SjnERm; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=eYxNhogp; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=x6SjnERm; spf=pass (imf08.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733244782; 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=YCG6fySiqfNEGp9DUV8Jp97kXk+ZYU355dns/Au2Frc=; b=YMvHT3lRsU8s9xVQdFf79jgb6ZCK6+S7ukTJ4wKpUKhb2wzZbF6vBKB1+sjE4rBoEc9aFt eOhCBwLnfk2gi5/82qaQfiqotbQ+mMDM2C0vBCprPB6S7NCL0bZiFz72dXRltEejYzKsMm OkyJQ6p0cVpnhgViX9tFpjQiyD6+JWg= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=eYxNhogp; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=x6SjnERm; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=eYxNhogp; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=x6SjnERm; spf=pass (imf08.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733244782; a=rsa-sha256; cv=none; b=JOYyjITovtkOhW6kCftfPgK9MVD9ps+GUVbcrpRM/wd0FPl0e44YZzCbJ0dCDTeACvUg2J WuslKeC72GqHIqR9MAnKb8gdRk0trMkK43Zmij6MgtR4e6Fga5URp32t1fGYuSU+59MHLS Vm2eNvXuLBCSo/G9avj3byW6t7S7uqc= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out1.suse.de (Postfix) with ESMTPS id 73945210F9; Tue, 3 Dec 2024 16:53:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1733244794; 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=YCG6fySiqfNEGp9DUV8Jp97kXk+ZYU355dns/Au2Frc=; b=eYxNhogpGOD/P9r3fnyK6kCsAZ9GABbd9b4BdEbMe2VV99SAQGxI1rf5wjDhLX+01u3z3o rmDAcLZr7E6AyGwyvvmSRxAri71L29FNbpmpGFpWUML0htPapGX6rrw3hI/XaUJZLjfX/u hu8es9KOTaKdRfrWP0eqaKtcGXb8kI4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1733244794; 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=YCG6fySiqfNEGp9DUV8Jp97kXk+ZYU355dns/Au2Frc=; b=x6SjnERmEemxkniR38O0OiI94QkC0Xz3+FTVZw3seAqbz5pqdYWkb3j1nmWv3GZ5G8Mzr6 8L5LUTZWOlTapCCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1733244794; 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=YCG6fySiqfNEGp9DUV8Jp97kXk+ZYU355dns/Au2Frc=; b=eYxNhogpGOD/P9r3fnyK6kCsAZ9GABbd9b4BdEbMe2VV99SAQGxI1rf5wjDhLX+01u3z3o rmDAcLZr7E6AyGwyvvmSRxAri71L29FNbpmpGFpWUML0htPapGX6rrw3hI/XaUJZLjfX/u hu8es9KOTaKdRfrWP0eqaKtcGXb8kI4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1733244794; 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=YCG6fySiqfNEGp9DUV8Jp97kXk+ZYU355dns/Au2Frc=; b=x6SjnERmEemxkniR38O0OiI94QkC0Xz3+FTVZw3seAqbz5pqdYWkb3j1nmWv3GZ5G8Mzr6 8L5LUTZWOlTapCCg== 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 604BA139C2; Tue, 3 Dec 2024 16:53:14 +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 f1wsF3o3T2eFYwAAD6G6ig (envelope-from ); Tue, 03 Dec 2024 16:53:14 +0000 Message-ID: Date: Tue, 3 Dec 2024 17:53:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 01/15] mm/page_alloc: Cache page_zone() result in free_unref_page() Content-Language: en-US To: "Matthew Wilcox (Oracle)" , Andrew Morton Cc: linux-mm@kvack.org, David Hildenbrand , Miaohe Lin , Muchun Song , Mel Gorman References: <20241125210149.2976098-1-willy@infradead.org> <20241125210149.2976098-2-willy@infradead.org> From: Vlastimil Babka In-Reply-To: <20241125210149.2976098-2-willy@infradead.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Action: no action X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5BF6A160011 X-Rspam-User: X-Stat-Signature: uacnr59xp33p3mkk77snp7734r73x3rn X-HE-Tag: 1733244787-787363 X-HE-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froWfuywdhP80Kuv7+YaiLQM8jNsaga8UcvJ0O0kAr+rS28K1fEjX2Obc0gdGNfkO0gzOiLvcAIvFr3jeahafKeCxWikHO3FIZaLACLUk9JPQ6gjs5J9paDkRmmJLj1b36CgPAiT+20zvSZhl10dewI0SWqglrftHJQKKwgcP/R/Mqqgp1EjkFqCAzDdpxKm/OUOo6WTTAB3wLkKWdmZd0LO4Nr2YvnXa9ILT77pnKz8BsgCLjzqWVT6GqlIeyWTNNaZyJekpGCU4ozNxw5fzinng/NYzJ/acaI4r8x3Jwute3xUp77zqVj0HY2HrUjfDaGOP7gPdtWLQVLII6TlBiKrPaEcFwj8zgGjB/bFGu9LxzQZ0bycM8mxI4ZBacGn8kwUvDxQG7t3peliDgbsiCEhTszrJRKpevTwgV87Q== 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 11/25/24 22:01, Matthew Wilcox (Oracle) wrote: > Save 17 bytes of text by calculating page_zone() once instead of twice. > > Reviewed-by: Miaohe Lin > Reviewed-by: Muchun Song > Acked-by: Mel Gorman > Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Vlastimil Babka > --- > mm/page_alloc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index a8cd54c02f13..c40a0c29a89c 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2700,16 +2700,16 @@ void free_unref_page(struct page *page, unsigned int order) > * get those areas back if necessary. Otherwise, we may have to free > * excessively into the page allocator > */ > + zone = page_zone(page); > migratetype = get_pfnblock_migratetype(page, pfn); > if (unlikely(migratetype >= MIGRATE_PCPTYPES)) { > if (unlikely(is_migrate_isolate(migratetype))) { > - free_one_page(page_zone(page), page, pfn, order, FPI_NONE); > + free_one_page(zone, page, pfn, order, FPI_NONE); > return; > } > migratetype = MIGRATE_MOVABLE; > } > > - zone = page_zone(page); > pcp_trylock_prepare(UP_flags); > pcp = pcp_spin_trylock(zone->per_cpu_pageset); > if (pcp) {