Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp696790lqp; Wed, 12 Jun 2024 13:27:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4lO59Buiqpf1SI+tdnDpDKI661DwdsS2q3Zms7BT6fHLALG7sUgLT51etAfZU4l4pRQekGFPEMpkWbe9BonfJ3nZHE6d+IBfDaEBBUA== X-Google-Smtp-Source: AGHT+IEf2lIxcaWZnC1Yvftq9ELZlhx8Mqpz+OZ0VeoqAjyGCsFI4tRQF1/kUpebwj3didKmXJyu X-Received: by 2002:a50:c082:0:b0:579:e7c5:1001 with SMTP id 4fb4d7f45d1cf-57ca976a585mr1580218a12.23.1718224040463; Wed, 12 Jun 2024 13:27:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718224040; cv=pass; d=google.com; s=arc-20160816; b=XdEW8vXka6gXsOrRaoF3+eMnjXU9stJqvJA40rTkzJNvw5Ns766VbPB7wAeormmLcw vzUJZctdGfbNd09Ixnqj+twzNAAlz/qi1vLXYzfEXO/ryPNc+7NJaLeJjpadD6JUQY2r o+JPwXxaQ4TsfwYm6FmVDWktCpwCVp6OwPdr7SRy8WxvhAl/TZXDv5eqObYbanZ1lZgC DTGVpByTk052OEC3VCxTkRRhyeMw9zyB++8jgw0FSq8oC6Gq8Xan9ihzfdhUmi2so4Pm NZQHhMD5KPlr7NOPBWEPTEUuzWTkvHgpdukWqEg4qjFS81X+1VmGD2K23kHArfQdSil9 dM6w== 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=1VFuCUnuEepepF/nbFXGdMItjf3Q4jDShXXipYKEUy8=; fh=eBRd6jknnto4l+sMOQcuBhkOd7NKV38dIsIYl9k4H38=; b=LTYbQr0dzx/WKeMpTI7ulM2IQCqkW0SPpLCgvcPVcC3OOZsf/hK/Y0wy3l5JbdtClm Ak6E/yE4GCmIYOgeagMaZeYy97Jx+cY6zi2zV+gQ4g4RXkNX6HLl+ofKckCjTaRYfLeH QfT9qDtl80HqNqXFZvXThVGt8302bSbXZwRJD/6PRt00x1lyNsQXWres8gWb3QO7tmbN ixC/g90+PletZKrnJ0WY8ndYhsKzmgoCnQXhXmP87XMAupJJVJsoFp7dr0E+s75ub+um PIteg6N8DMbYV5lFQoArYZOhYQrkabB4lCYzKXndOXNcPd9dWz/9FKV1TLISOval1rYS oSNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HwgdMkpr; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HwgdMkpr; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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-212221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c74767514si4403388a12.566.2024.06.12.13.27.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 13:27:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HwgdMkpr; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HwgdMkpr; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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-212221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212221-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3164C1F25139 for ; Wed, 12 Jun 2024 20:27:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73FCE84D0E; Wed, 12 Jun 2024 20:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="HwgdMkpr"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="r+CigeT+"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="HwgdMkpr"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="r+CigeT+" 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 9B75F84A56 for ; Wed, 12 Jun 2024 20:27:04 +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=1718224026; cv=none; b=AC2wYnT5/1g4EZE0EHf7MgaYTCJpUuXapcMCrWTE4XHpn/vPWhZAm12wDfzx+m9bbXOFXHqdMI4M7CnYXs/vlZmMwWDjFqNixQT78EwFQju9FfhF8gRen67hLajNptvcss7WhbcdGkpkN70b6ywpA9MDroe+xirh9vRlwB+y8K0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718224026; c=relaxed/simple; bh=D9xEEAQmTsgEo9UDUmSclz/a0tD4gHdbLxDsMPCyR4U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jda25kE8F7Vqjp43mEdRD/CuoEiFurWZ4nAJ2mfjcuZtG7d//k/tL1azQYY+/jGzJansgjtcMqh+3sIkKaC4c2FbRpElq+hP+Pw2qbgvPw6gGkT4rUZgrmDNtxkklCoxv6E6gUU86D4857fEb8jPks81I+acoGzCLXzm/EKxexY= 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=HwgdMkpr; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=r+CigeT+; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=HwgdMkpr; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=r+CigeT+; 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 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-out2.suse.de (Postfix) with ESMTPS id 9FB255C700; Wed, 12 Jun 2024 20:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718224022; 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=1VFuCUnuEepepF/nbFXGdMItjf3Q4jDShXXipYKEUy8=; b=HwgdMkprsrWlowzdN0AurD8/qlL6BHBjM6iGkmzEsFQj49bK4dWsgjwEQhzNU8IjlliE2P q8Rj948CkYMq6aAJEv9T7SQdsJ7kZMcySRHaWDAyoY/4FG0eNN5Yy9CjqLmw8RV01AeIgi jCGk7koUgSzmqlnbp255TDiGsLoh2TY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718224022; 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=1VFuCUnuEepepF/nbFXGdMItjf3Q4jDShXXipYKEUy8=; b=r+CigeT+ebgc3nxPN7HvLvku6DTB0GTcJ722AIQzu2pPI/HhvI7fPocDaWO2+mvfHPDoDO RJ7SUIc0ePmkmVCA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=HwgdMkpr; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=r+CigeT+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718224022; 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=1VFuCUnuEepepF/nbFXGdMItjf3Q4jDShXXipYKEUy8=; b=HwgdMkprsrWlowzdN0AurD8/qlL6BHBjM6iGkmzEsFQj49bK4dWsgjwEQhzNU8IjlliE2P q8Rj948CkYMq6aAJEv9T7SQdsJ7kZMcySRHaWDAyoY/4FG0eNN5Yy9CjqLmw8RV01AeIgi jCGk7koUgSzmqlnbp255TDiGsLoh2TY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718224022; 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=1VFuCUnuEepepF/nbFXGdMItjf3Q4jDShXXipYKEUy8=; b=r+CigeT+ebgc3nxPN7HvLvku6DTB0GTcJ722AIQzu2pPI/HhvI7fPocDaWO2+mvfHPDoDO RJ7SUIc0ePmkmVCA== 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 47F9C1372E; Wed, 12 Jun 2024 20:27:02 +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 IbqSDpYEambxKgAAD6G6ig (envelope-from ); Wed, 12 Jun 2024 20:27:02 +0000 Date: Wed, 12 Jun 2024 22:27:00 +0200 From: Oscar Salvador To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Muchun Song , Vishal Moola Subject: Re: [PATCH] mm/hugetlb: Move vmf_anon_prepare upfront in hugetlb_wp Message-ID: References: <20240521073446.23185-1-osalvador@suse.de> 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: <20240521073446.23185-1-osalvador@suse.de> X-Rspamd-Queue-Id: 9FB255C700 X-Spam-Score: -5.01 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-5.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_CC(0.00)[vger.kernel.org,kvack.org,linux.dev,gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TAGGED_RCPT(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:dkim] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org On Tue, May 21, 2024 at 09:34:46AM +0200, Oscar Salvador wrote: > hugetlb_wp calls vmf_anon_prepare() after having allocated a page, which > means that we might need to call restore_reserve_on_error() upon error. > vmf_anon_prepare() releases the vma lock before returning, but > restore_reserve_on_error() expects the vma lock to be held by the caller. > > Fix it by calling vmf_anon_prepare() before allocating the page. > > Signed-off-by: Oscar Salvador > Fixes: 9acad7ba3e25 ("hugetlb: use vmf_anon_prepare() instead of anon_vma_prepare()") Let me just revamp this and run away -- Oscar Salvador SUSE Labs