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 8BE09E7716B for ; Wed, 4 Dec 2024 09:15:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0CFEC6B007B; Wed, 4 Dec 2024 04:15:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 07F0D6B0082; Wed, 4 Dec 2024 04:15:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E87FD6B0083; Wed, 4 Dec 2024 04:15:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C8A266B007B for ; Wed, 4 Dec 2024 04:15:28 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7FB78140EAB for ; Wed, 4 Dec 2024 09:15:28 +0000 (UTC) X-FDA: 82856718042.18.2D9FC8F Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf04.hostedemail.com (Postfix) with ESMTP id C979140015 for ; Wed, 4 Dec 2024 09:15:10 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733303711; 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: in-reply-to:in-reply-to:references:references; bh=/xTdJKRQEzILVq1FIyzNiL8lvaQRqJgK/zyGTatPF1c=; b=YohWRhH14QXl8S6y3bmxu5X3n9C4EqkXsgLyPCebxBmq2w/dMZOs1zwDS7vqRL911NcT0k 1hduU8uDgkwhuc/akyxhX2+PNzXZLAkIjV9+Tw1l5Mp0UyMNMaoxIZ5iXjqXIbGP+yU0kv q4A+j7m78hEycHAEZ2lwYeOJiJal22Q= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733303711; a=rsa-sha256; cv=none; b=hI65pp0h79q7Mx2WTwQxYEk6GZBjFMFVQ8Pn/VzvbY0MXjUl1N4Lq0X/H2lca+CRS0chiW acA9O0cWbYMUqawEPAsBoj7wJJ+kHzmFUM/k468v6AKkGXLsy0xpCuLXUZOBSztDFLO+JB Lufd+QsEor1zkngOdbjSJ3ukPZYOUeU= 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 F26A72115C; Wed, 4 Dec 2024 09:15:24 +0000 (UTC) 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 51565139C2; Wed, 4 Dec 2024 09:15:24 +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 wN0nEawdUGfYaAAAD6G6ig (envelope-from ); Wed, 04 Dec 2024 09:15:24 +0000 Date: Wed, 4 Dec 2024 10:15:14 +0100 From: Oscar Salvador To: Vlastimil Babka Cc: David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, Andrew Morton , Zi Yan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan Subject: Re: [PATCH RESEND v2 4/6] mm/page_alloc: sort out the alloc_contig_range() gfp flags mess Message-ID: References: <20241203094732.200195-1-david@redhat.com> <20241203094732.200195-5-david@redhat.com> <96c92857-4850-4f85-9474-ac193c5ea48c@redhat.com> <04c1d28e-bbea-4499-9a6d-770f9ca53ba9@suse.cz> <15096b27-6f27-45fc-8a8b-de781a9c42a5@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15096b27-6f27-45fc-8a8b-de781a9c42a5@suse.cz> X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: C979140015 X-Rspam-User: X-Stat-Signature: 48zruhpq9cyjsfap1s659c4h6xxoygaa X-HE-Tag: 1733303710-3774 X-HE-Meta: U2FsdGVkX1+OSjrndAqm0IpwbZ3jpJAgFXsCx1OWWrwhWNIKdqkvet/PK6y0vMdyuF0EusbpNU1MZujSh/Oh5vb+huT3ikjOa6vWNQkQabJ97RcaIcvT/MTV22cgXecxMFcL5JNwoN1704FMgbSYWpiz1L64BqkrQtO8fz63j4ypTWcF9t1QdvYXmZB69awG9oYqEXGmED4VcMF5xQiVTZ285dDfaDbFHdAakl2BOSKkRFgXFXIIOnVGDGEozDbsPwCJoJDB5Ku4VDcl2nKTRavU5YyiijXZpOVMIlNbN74NdwKs8atRoKLGkAhXh7fJpSvSYms9Vp07FLBpde7xZzxeqDbfb8E8kYe4E7+0TKd7lQRJTEbPh7aDSkMWsqF+ZpITDCRXVpRTGgWOcyqRw/PtQQ98Lpzwk3d59EgUWf5+5FZYl4lkQAr/+EWzoFMzBUzTxD+eP+850D5M+zlQmjUkvhjyH4+F3xFMbHcvEzQV3oAJty6yGo6b+6dydDflkTHuHCdrXLsDyPhoEEazRPVFAl+6Pb6WuiHvWIdVAIU/Rc7xOMkt3G2hP6dKOnc5vl8T2UciyQrv1L6/SctZlNBGL/KxAd7J+guBtINsnRqp6vApZCAiVHV3QtKeoDxnCwpUW4X0dsMJ4KeEIm9aaf9EyducoJO+tCp6f4VNx/BqZEK0JtyID7T7YsY/qpRbYJlFveKJjfGYamradBCkLQr5zK9zzrx61ObZIMDTzx2hSsHU6IFcCKdpIZMhENHyz5tMyRwedxpkqPHJ0ug1EznuOr6nU1BYmdtm6qWDYrkcidPJOGfhXC/pksBXImAPcu2fDRXFROPJUadVmu33AL39tObUSkY4jwYQx2dUAC4Bbs1NiiM5XETVprAcSazY0UgVUe3f8sBzsbCakAxJ6WTD2x5XZpCkp7Fr3UoTFB7vMSMnOEYBmx6s6w1Mr3Ddjk/ieTnF4pO8q/Px9+a xzoqkVzd +KwnOIo24eGz1Tq4BW51LRhKM0+jCbJ30D3QeaDjndlS5j5ijV+TfAH52+EbwRnMRiopD92xd/BbNNP5m4wLiPpiAZCcOW1QaV0+nzYVGDZ5GGawynxfnKVk1VMn4JM1KyAGwEsac/NY/xOljKuD3Ok7mBYuJ90vQou1m9y8q2Jd74dP8yv+pJ3Id6g== 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 Wed, Dec 04, 2024 at 10:03:28AM +0100, Vlastimil Babka wrote: > On 12/4/24 09:59, Oscar Salvador wrote: > > On Tue, Dec 03, 2024 at 08:19:02PM +0100, David Hildenbrand wrote: > >> It was always set using "GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL", > >> and I removed the same flag combination in #2 from memory offline code, and > >> we do have the exact same thing in do_migrate_range() in > >> mm/memory_hotplug.c. > >> > >> We should investigate if__GFP_HARDWALL is the right thing to use here, and > >> if we can get rid of that by switching to GFP_KERNEL in all these places. > > > > Why would not we want __GFP_HARDWALL set? > > Without it, we could potentially migrate the page to a node which is not > > part of the cpuset of the task that originally allocated it, thus violating the > > policy? Is not that a problem? > > The task doing the alloc_contig_range() will likely not be the same task as > the one that originally allocated the page, so its policy would be > different, no? So even with __GFP_HARDWALL we might be already migrating > outside the original tasks's constraint? Am I missing something? Yes, that is right, I thought we derive the policy from the old page somehow when migrating it, but reading the code does not seem to be the case. Looking at prepare_alloc_pages(), if !ac->nodemask, which would be the case here, we would get the policy from the current task (alloc_contig_range()) when cpusets are enabled. So yes, I am a bit puzzled why __GFP_HARDWALL was chosen in the first place. -- Oscar Salvador SUSE Labs