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 E3AE2C28B20 for ; Fri, 28 Mar 2025 13:41:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE745280145; Fri, 28 Mar 2025 09:41:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A70B628013E; Fri, 28 Mar 2025 09:41:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EB0E280145; Fri, 28 Mar 2025 09:41:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6BAC628013E for ; Fri, 28 Mar 2025 09:41:36 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 910E11C7511 for ; Fri, 28 Mar 2025 13:41:36 +0000 (UTC) X-FDA: 83271072192.27.4A287C9 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf09.hostedemail.com (Postfix) with ESMTP id 0E2CB140014 for ; Fri, 28 Mar 2025 13:41:32 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=j2toeNh8; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=5Bo1P7sW; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=iNfQb7Ky; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=k5F9OSjG; spf=pass (imf09.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=1743169293; 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=+MBso25A4j+vQm/GwU67tTVb2zT40od14o/qULil9ik=; b=KQ4QvNqsA8vDB3rSeTufxmAEyyn7ayX1xQq0Mog9NeN18UczgR5g3CBoi4vsrzZI63QDKF EKU+UW4vdeDEQb6MsdeOfE2/xBO75LojDULtjgUBaBxlpLTsxoGDin4xeFnPvDxEuXbIl2 d6TSohl3vYe3W6HPgbuL9+8qsEpPEPE= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=j2toeNh8; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=5Bo1P7sW; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=iNfQb7Ky; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=k5F9OSjG; spf=pass (imf09.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=1743169293; a=rsa-sha256; cv=none; b=WBzoLe/ZWuPdkk3jKe1KiVhUnoWkPl5mC68gpeJo5e72yT0D2FiuaJ8mGNKFpohbYihWJn 9MDP0sjBU2N6hMaJyafY/CPkv3zN8SD+yHbjTRyFSR3vco57EuZ8VUE2JtnK9sdqmqJA66 JRhKTe9nJb84/t7qe04uIO1TNZo9ZXs= 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 E56BB211A8; Fri, 28 Mar 2025 13:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1743169291; 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=+MBso25A4j+vQm/GwU67tTVb2zT40od14o/qULil9ik=; b=j2toeNh8uRilKu1yZeLXm95GObbEpL4rZPERZH5iYs+dQC+Pb2i89pvrO19L3n7V6Qo70A S7YqT0vkgJT+kNzVpV7lmobNCXhVOjopuVB2UKxOpb+z5g09hfk2WOJWmMhC9bsQP9RnvL IATClCWVRG5RxavFGTfrqN2xAPw7zTc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1743169291; 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=+MBso25A4j+vQm/GwU67tTVb2zT40od14o/qULil9ik=; b=5Bo1P7sWxsWQm8oEJm6OF174PQ+vEsaNCs/mLT0e7VCF7KCYonqi13TMEsVzKvwOUY/z6q cjsonYOIJwl9UXBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1743169290; 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=+MBso25A4j+vQm/GwU67tTVb2zT40od14o/qULil9ik=; b=iNfQb7KyrDHn/ekPK68bbRCnsRGJG0N1+bsk5mKiG/bmL3yfJo4y+Cvio3U1qFl/ONMrpr YqQJ1QeasM7EWAIroeJBna1MmF5pmWJ8JViuwPPNRTtKLNm0UHWES6ESBMqfNLltntZRWL Obl5VqidJUeApq2DoZk5vEvtVCcRwJQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1743169290; 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=+MBso25A4j+vQm/GwU67tTVb2zT40od14o/qULil9ik=; b=k5F9OSjGAut1QFBPfUa4lDN2pvC4KO9iX9VmkKt8mm6ev4FCnmfFi6kAwLFKYEdT9Is276 NOrS5PgmhNO47wAw== 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 0BC8E13998; Fri, 28 Mar 2025 13:41:29 +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 b0mIOwmn5meyZwAAD6G6ig (envelope-from ); Fri, 28 Mar 2025 13:41:29 +0000 Date: Fri, 28 Mar 2025 14:41:28 +0100 From: Oscar Salvador To: Simon Wang =?utf-8?B?KOeOi+S8oOWbvSk=?= Cc: Matthew Wilcox , "akpm@linux-foundation.org" , "mhiramat@kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mm: migrate: restore the nmask after successfully allocating on the target node Message-ID: References: <9e14314cd04645409699ece39443765a@inspur.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9e14314cd04645409699ece39443765a@inspur.com> X-Rspamd-Action: no action X-Rspamd-Queue-Id: 0E2CB140014 X-Stat-Signature: 19mrmzfpse9qmxqiswahras6wcirqr7g X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1743169292-238791 X-HE-Meta: U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YOGk3PeysW1l4LcBoDXPe2iyczggO0TzEF4BpY1zLetAX5+igUxKq0GfSV3+Qw6u1WY3uCudhXmgV/xge6MerW8OH3qXaN1Y7/Zb5d7wMn4o5c1uOTuUz4nwd6WqO7YiMDJsCGviBflx/LaKv3kAIKJglIYq9rBNtmo5VPFRFbhmt2+NktBWWnQeOmb X-Bogosity: Ham, tests=bogofilter, spamicity=0.002005, 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, Mar 26, 2025 at 05:54:35AM +0000, Simon Wang (王传国) wrote: > > > On Wed, Mar 26, 2025 at 11:12:18AM +0800, wangchuanguo wrote: > > > If memory is successfully allocated on the target node and the > > > function directly returns without value restore for nmask, non-first > > > migration operations in migrate_pages() by again label may ignore the > > > nmask settings, thereby allowing new memory allocations for migration > > > on any node. > > > > I have no opinion on whether this is the right thing to do or not, but if it is > > > > I don't think so. When memory allocation fails on the target node, there is already a recovery operation for the nmask value below. Therefore, the nmask value should only be restored when memory allocation is successfully completed on the target node. But that is not what the code is doing, is it? With the changes applied I mean. You are restoring mtc->nmask in case you managed to allocate for __GFP_THISNODE and after you clear the flag, so we might as well do it just once at the beginning after calling alloc_migration_target for the first time. -- Oscar Salvador SUSE Labs