Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1983867rbb; Tue, 27 Feb 2024 07:16:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXXwQp6ItIUzzgaLXPpXkRLnu3yw8bIEWB1ZXdGR+3EBY7OvVG/I08lu0UD/Z4QCOowBWndLt+cIZ/2KwSU2wxueo/GslTVhlj82LtvsQ== X-Google-Smtp-Source: AGHT+IHAelnra9Dh7KI8jNxpKG+svjwIYJnQAVlQJqRipNx1PnnMWjkd5jMK4RbK+6/XqjT/NSoJ X-Received: by 2002:a05:6808:13cd:b0:3c1:ae29:56ff with SMTP id d13-20020a05680813cd00b003c1ae2956ffmr2261707oiw.10.1709046973526; Tue, 27 Feb 2024 07:16:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709046973; cv=pass; d=google.com; s=arc-20160816; b=iKtFt/QkTk0Enh9SYFCbR6I+K+nwmpZLxGvfgn7Le11yfMv4BFZ8U2lFh4MKqcTC2H VeCQDRN9VKO/58nsDAb3n3LxYnY6uiaHFfARM4uE7ctwKuC7DtjTU4rkBNCHwqnqY2/X 0jaUlIneWXEWNfSxtPJ3vudJ8yjTK2zdc74wElD7naIVFLXkrtKwekYImKJymxTigy7U V47F6OPLwi8pva8xIO7i/kLBtYiCCFmDsI7CPhv6v0aYFMbYwD+1R5G2mAmwfgKf9qvj urDJSTJns1BJvZufFMFLnvshDpRqo8H1RqksLMJVGseYYTj7aoW2ilGJfGZvaKza4Te9 d5fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=JZ/KbhKK6eGZmN0r12OosY6StcJkfekJBBlgQb36fNs=; fh=29kF3k1G5XnfnvBx80C0WmNjEVW4PA3+/HN+wTUqsak=; b=LzVD+0BQ/guUWS3oGlMVDDYwYGelcRHRwV+oO2I/guPpK1DbleSwYXidCoLdJI4N9W 7CU2a5fz5a3nDkwoYwbzJq5y6qQTf9iEPxs+kC9eh7c73Vesdqbu9ili+lr0czR4cLoz Ege15gXLuwKXng/xym55WKnNTM4mv6xIedvVAADz4hDQXNzIffUsSpcCqxu0hYP+FpR9 6vFrxGMKCWzUrKsomxWelyNTxZoBYtGw7aYB+6GAoXsls1lb6ammhbaaMpPugLx8cRDN yTSwxKXTnfm1TFMZ65MKrfD76B+WothAXzbvzWUeaZWIRc5l99+pGl2mW4xrktvW63xc /V9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=VihdrFF9; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=VihdrFF9; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=NMhDP5Sr; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-83483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83483-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id iq20-20020a056130629400b007d9760a3600si1182737uab.189.2024.02.27.07.16.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 07:16:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=VihdrFF9; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=VihdrFF9; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=NMhDP5Sr; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-83483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83483-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 304A71C22871 for ; Tue, 27 Feb 2024 15:16:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79F951420B3; Tue, 27 Feb 2024 15:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="VihdrFF9"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="NMhDP5Sr"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="VihdrFF9"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="NMhDP5Sr" 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 2152D31A66 for ; Tue, 27 Feb 2024 15:16:05 +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=1709046967; cv=none; b=oVODlG1DeDxA1GVtsrIfldKp7FeLqJgsGqhRcT5m9bsHnyKtZEvY1ZbC+Y4rZcBrLLTiGyjDU7N0vYtzaLCiR7Jur5PxS+B9BNUzVuBiPsDXciNKZcm/Os3IFakMPo/t1xoQ90ml/KRIzF5kgMCC+dd/zo3lvmxAfpLGrJRWJBo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709046967; c=relaxed/simple; bh=Q704lxGdAk8nqsO2ILkxfXxqEZFSFyafTT484ut52dc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FlTyw2pIu07KdbGTZrJ5xxY5Y8KptoSrP63wBn4rk0f+FmZxBqX5ioV7WrANj4ml74pErZlrC5q9uxjdm6YcxHGwNZpN+Htc9rUp2W5oMUwV3dXq8ZVBJxyXafJki/gtxDkgKm2PGaBPM8BwFRulQ9VeGEc1J5Xdgb7Kft707Qk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=VihdrFF9; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=NMhDP5Sr; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=VihdrFF9; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=NMhDP5Sr; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 126001F461; Tue, 27 Feb 2024 15:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709046964; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JZ/KbhKK6eGZmN0r12OosY6StcJkfekJBBlgQb36fNs=; b=VihdrFF9d8S5FVkYKn0hTax4UqSvWcJSafsUOBjEuW/b0t3AxnpQhAzgdPA5w60MO4sHcN G7qED5PcgNwEsI/mnAZeVEYBiGJYL17ChY3iBVZbvP6crKra17TNR/3IOcnlSe/wftV1HN uG18XWA4N94q+NhpkogQxoONLXne+nE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709046964; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JZ/KbhKK6eGZmN0r12OosY6StcJkfekJBBlgQb36fNs=; b=NMhDP5SrF32zrAya4SDOW10wyzx20ZZS4aVxt/qGF3QwXfrXCK/7mztyv/y8GJdA013jXz ueH3GpsERrrDxzCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709046964; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JZ/KbhKK6eGZmN0r12OosY6StcJkfekJBBlgQb36fNs=; b=VihdrFF9d8S5FVkYKn0hTax4UqSvWcJSafsUOBjEuW/b0t3AxnpQhAzgdPA5w60MO4sHcN G7qED5PcgNwEsI/mnAZeVEYBiGJYL17ChY3iBVZbvP6crKra17TNR/3IOcnlSe/wftV1HN uG18XWA4N94q+NhpkogQxoONLXne+nE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709046964; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JZ/KbhKK6eGZmN0r12OosY6StcJkfekJBBlgQb36fNs=; b=NMhDP5SrF32zrAya4SDOW10wyzx20ZZS4aVxt/qGF3QwXfrXCK/7mztyv/y8GJdA013jXz ueH3GpsERrrDxzCw== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 8512213419; Tue, 27 Feb 2024 15:16:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id uPTFHbP83WVSCAAAn2gu4w (envelope-from ); Tue, 27 Feb 2024 15:16:03 +0000 Date: Tue, 27 Feb 2024 16:17:16 +0100 From: Oscar Salvador To: Baolin Wang Cc: akpm@linux-foundation.org, muchun.song@linux.dev, david@redhat.com, linmiaohe@huawei.com, naoya.horiguchi@nec.com, mhocko@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] mm: hugetlb: make the hugetlb migration strategy consistent Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=VihdrFF9; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=NMhDP5Sr X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-5.78 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[9]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-0.999]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.27)[96.57%] X-Spam-Score: -5.78 X-Rspamd-Queue-Id: 126001F461 X-Spam-Flag: NO On Tue, Feb 27, 2024 at 09:52:26PM +0800, Baolin Wang wrote: > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -2567,13 +2567,38 @@ static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h, > } > > static struct folio *alloc_migrate_hugetlb_folio(struct hstate *h, gfp_t gfp_mask, > - int nid, nodemask_t *nmask) > + int nid, nodemask_t *nmask, int reason) I still dislike taking the reason argument this far, and I'd rather have this as a boolean specifing whether we allow fallback on other nodes. That would mean parsing the reason in alloc_migration_target(). If we don't add a new helper e.g: gfp_allow_fallback(), we can just do it right there an opencode it with a e.g: macro etc. Although doing it in an inline helper might help hiding these details. That's my take on this, but let's see what others have to say. -- Oscar Salvador SUSE Labs