From nobody Mon Feb 9 19:26:47 2026 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 EA2CD2110E for ; Thu, 4 Jul 2024 04:31:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720067516; cv=none; b=PtUR4ntNL+w4htnsVO3lh0GGY7c+PHIbEag3816kBkBrvIdku11dOVG3tnksMqGbiKPo6ZhFhkAOYrKYL8Gatb9jJO2nO8ND9dR5JDDaOV2qgAW6EQNzDUU30+1SpHEwCA9EkLmROxBJpVpNDWMkB/WpbiV0J2L3Er3HMeaYtSQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720067516; c=relaxed/simple; bh=m9zPXLXTm/mgl/dYIUFDktPz6b3OWubcd5U7cMa8rxw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G+7MxQViVxsi6H9i+fEN1oho/w5dwc4tcid6RhpP7YsB+xjAIJWJ2o96zhj7VnqIg2zmA7ZtXuKaRAxGwaZCb7ig90YTshBgPTHa5vXUuMeCfLMWvEf47Y24JH+CnMf/J9Zn94EF4Uj0WdTwdv9RrhzXKRNd7WuKonBOcQDcpZI= 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; arc=none smtp.client-ip=195.135.223.130 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-out1.suse.de (Postfix) with ESMTPS id 359EE21180; Thu, 4 Jul 2024 04:31:53 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none 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 044A513889; Thu, 4 Jul 2024 04:31:51 +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 4D3mN7clhmbnDAAAD6G6ig (envelope-from ); Thu, 04 Jul 2024 04:31:51 +0000 From: Oscar Salvador To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Xu , Muchun Song , David Hildenbrand , SeongJae Park , Miaohe Lin , Michal Hocko , Matthew Wilcox , Christophe Leroy , Oscar Salvador Subject: [PATCH 03/45] mm/pagewalk: Move vma_pgtable_walk_begin and vma_pgtable_walk_end upfront Date: Thu, 4 Jul 2024 06:30:50 +0200 Message-ID: <20240704043132.28501-4-osalvador@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240704043132.28501-1-osalvador@suse.de> References: <20240704043132.28501-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-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Queue-Id: 359EE21180 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: Content-Type: text/plain; charset="utf-8" In order to prepare walk_pgd_range for handling hugetlb pages, move the hugetlb vma locking into __walk_page_range. Signed-off-by: Oscar Salvador --- mm/pagewalk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/pagewalk.c b/mm/pagewalk.c index ae2f08ce991b..eba705def9a0 100644 --- a/mm/pagewalk.c +++ b/mm/pagewalk.c @@ -269,7 +269,6 @@ static int walk_hugetlb_range(unsigned long addr, unsig= ned long end, const struct mm_walk_ops *ops =3D walk->ops; int err =3D 0; =20 - hugetlb_vma_lock_read(vma); do { next =3D hugetlb_entry_end(h, addr, end); pte =3D hugetlb_walk(vma, addr & hmask, sz); @@ -280,7 +279,6 @@ static int walk_hugetlb_range(unsigned long addr, unsig= ned long end, if (err) break; } while (addr =3D next, addr !=3D end); - hugetlb_vma_unlock_read(vma); =20 return err; } @@ -339,11 +337,13 @@ static int __walk_page_range(unsigned long start, uns= igned long end, return err; } =20 + vma_pgtable_walk_begin(vma); if (is_vm_hugetlb_page(vma)) { if (ops->hugetlb_entry) err =3D walk_hugetlb_range(start, end, walk); } else err =3D walk_pgd_range(start, end, walk); + vma_pgtable_walk_end(vma); =20 if (ops->post_vma) ops->post_vma(walk); --=20 2.26.2