From nobody Tue Feb 10 03:57:37 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 B5516145FE4 for ; Thu, 4 Jul 2024 04:32:29 +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=1720067551; cv=none; b=HgUdtnSxelfWlEkrOADXzzkgpPaxgx+kDa4GYY7i3Nacg+SEwn2FDladquXvfJG2Lqqv7oziXi2eNoI9yiN61gOWyms6SrNJeDomM7F02l9ypmAk49Io+OwgeypyUSmkbhbzxPniZ0e9y6xg1q7XSQVTx5VyYAj9ddTxozYBiBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720067551; c=relaxed/simple; bh=8hDZyNTIFcoLrIplaNZzSjI6izOqLgxUhvo8Qa79pnc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bh2LUTjMk7dwmdJLGV2huW5diwa2V4e20jKL49caSzEF7PRrN/RYJ+ywhNIF6tW0dvgAMhh/XrmlTLrWAJ3Od8qS43vpglxnOOHAj8KMVHSFBrJLp2EzMygVCdMSksYG7ofGcmahC7WNF+1IiA15oR3zduQBKILQG32inHAub5Q= 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 0FE1121C11; Thu, 4 Jul 2024 04:32:28 +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 DDC9613889; Thu, 4 Jul 2024 04:32:26 +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 qGv2MdolhmbnDAAAD6G6ig (envelope-from ); Thu, 04 Jul 2024 04:32:26 +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 30/45] mm,mincore: Enable mincore_pte_range to handle hugetlb vmas Date: Thu, 4 Jul 2024 06:31:17 +0200 Message-ID: <20240704043132.28501-31-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-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 0FE1121C11 X-Rspamd-Action: no action X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org Content-Type: text/plain; charset="utf-8" PMD-mapped hugetlb vmas will also mincore_pte_range. Add the required code so it knows how to handle those there. Signed-off-by: Oscar Salvador --- mm/mincore.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/mincore.c b/mm/mincore.c index d6bd19e520fc..5154bc705f60 100644 --- a/mm/mincore.c +++ b/mm/mincore.c @@ -18,6 +18,7 @@ #include #include #include +#include =20 #include #include "swap.h" @@ -106,8 +107,9 @@ static int mincore_pte_range(pmd_t *pmd, unsigned long = addr, unsigned long end, unsigned char *vec =3D walk->private; int nr =3D (end - addr) >> PAGE_SHIFT; =20 - ptl =3D pmd_trans_huge_lock(pmd, vma); + ptl =3D pmd_huge_lock(pmd, vma); if (ptl) { + /* Better handling of hugetlb is required (pte marker etc.) */ memset(vec, 1, nr); spin_unlock(ptl); goto out; --=20 2.26.2