Message ID | 20240704043132.28501-38-osalvador@suse.de (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 A7291C3065C for <linux-mm@archiver.kernel.org>; Thu, 4 Jul 2024 04:33:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 12E366B00C6; Thu, 4 Jul 2024 00:32:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B6726B00C7; Thu, 4 Jul 2024 00:32:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFC516B00C8; Thu, 4 Jul 2024 00:32:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B8FBB6B00C6 for <linux-mm@kvack.org>; Thu, 4 Jul 2024 00:32:40 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 77314A2DCB for <linux-mm@kvack.org>; Thu, 4 Jul 2024 04:32:40 +0000 (UTC) X-FDA: 82300799280.19.03C639A Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf22.hostedemail.com (Postfix) with ESMTP id 5FBC1C0011 for <linux-mm@kvack.org>; Thu, 4 Jul 2024 04:32:38 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=FLLFrGlR; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Xn+qmriL; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=FLLFrGlR; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Xn+qmriL; spf=pass (imf22.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=1720067535; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2Nyp1GchWN9j9DCiswMlchcq+0OOi/ydZqtxsOmg3fI=; b=MvAGKtg3mp53EjrR/vQSj4yp5DORtXaJRUuB876MsraO4jN3ABsEt5G4L1PdgLUe8KxAey jNvRdk/OquNn6hGdvW3P0ivTCEXM5MfWILdOOOa7YIM+h8S8q9ymFGIJRH6xyWKcH6OR71 96ua5X7ehUOvRZiyU/WFEKEiFOASkNw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720067535; a=rsa-sha256; cv=none; b=jKMSuBx1ZsNZsFMh5jKBax+vh6zfq9XbZ7RY9h1RFcYbx5fg1xHVcwU4BWCzlp5TUJM+Tm nWn9bT1CSC3YaQtN+C2BBchDdQ6vFppwHwKwF0j+uiPv2LjbxMqC1H/0o/2DCGQmVHXLVR Qnl26f9jjXI+jahlXjwWitRbRAcYgtM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=FLLFrGlR; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Xn+qmriL; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=FLLFrGlR; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Xn+qmriL; spf=pass (imf22.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 Received: from imap1.dmz-prg2.suse.org (unknown [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 166C121C0D; Thu, 4 Jul 2024 04:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1720067557; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2Nyp1GchWN9j9DCiswMlchcq+0OOi/ydZqtxsOmg3fI=; b=FLLFrGlRYQvTCYxVLiVDlOvcqdI03sK7tsIHp0UaVD2y3rWv0sfPku+5j1Sb+TGxATnbIj 2SvrEeBnu35COLNGzRhuWQiuv+d1fMu1ZxIzeBld3MHcaPV5255bX31dpcaYpS7sxPB+yj Wh3sG0PCXGnABuZy8kGWiY/fHIKMyn0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1720067557; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2Nyp1GchWN9j9DCiswMlchcq+0OOi/ydZqtxsOmg3fI=; b=Xn+qmriLdnNRRO+exHfJ7IQkKp73CpsQ6YRsMlGxYx0y8gyUntE4TOjbftU2SpDj9j99UM 4IbKv/L2PFMFs+CA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1720067557; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2Nyp1GchWN9j9DCiswMlchcq+0OOi/ydZqtxsOmg3fI=; b=FLLFrGlRYQvTCYxVLiVDlOvcqdI03sK7tsIHp0UaVD2y3rWv0sfPku+5j1Sb+TGxATnbIj 2SvrEeBnu35COLNGzRhuWQiuv+d1fMu1ZxIzeBld3MHcaPV5255bX31dpcaYpS7sxPB+yj Wh3sG0PCXGnABuZy8kGWiY/fHIKMyn0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1720067557; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2Nyp1GchWN9j9DCiswMlchcq+0OOi/ydZqtxsOmg3fI=; b=Xn+qmriLdnNRRO+exHfJ7IQkKp73CpsQ6YRsMlGxYx0y8gyUntE4TOjbftU2SpDj9j99UM 4IbKv/L2PFMFs+CA== 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 DDB1513889; Thu, 4 Jul 2024 04:32:35 +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 QI6DMOMlhmbnDAAAD6G6ig (envelope-from <osalvador@suse.de>); Thu, 04 Jul 2024 04:32:35 +0000 From: Oscar Salvador <osalvador@suse.de> To: Andrew Morton <akpm@linux-foundation.org> Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Xu <peterx@redhat.com>, Muchun Song <muchun.song@linux.dev>, David Hildenbrand <david@redhat.com>, SeongJae Park <sj@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>, Michal Hocko <mhocko@suse.com>, Matthew Wilcox <willy@infradead.org>, Christophe Leroy <christophe.leroy@csgroup.eu>, Oscar Salvador <osalvador@suse.de> Subject: [PATCH 37/45] mm/lock: Make mlock_test_walk skip hugetlb vmas Date: Thu, 4 Jul 2024 06:31:24 +0200 Message-ID: <20240704043132.28501-38-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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FBC1C0011 X-Stat-Signature: sj8paas3fysfr3kcfmmbtea5ffey75dn X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1720067558-68467 X-HE-Meta: U2FsdGVkX19KKlH3Z8RT5NBIkcv/nWUUjm6XEIdjz8sc1CWLx+VwrihnNsFEOPQxG5vVlO1iYNUWsbIoP7MczowgmexZdPH0umrAEAJNybqHPcWO+4Au4gN4Un5vB6AtfGFWauBaIRBoZV0S1e6CV6V+ad4HvUAJQlIipW20Coh4AC8bbWy9Dq2+Kwwc1gOwJPf0WDNva4LqJtsfKoFlWn4jKuQAeF5lkH8kBQpmiofh/ca6pkDP8qLZ+o/l8LVHG2s82i2ZBQHPGsdZNTQU+CjstCf2Tj6KE0/4JrWslBNchEnC3v519ipwP/erIeHYdTwEhObEg9wGYfKzDALxw47nXuN6VsDFCc8E3GJ6doCLDMD6sSJ+deiaO4EA9xGrLjdV0Dkte6Pit3+ybwkt5SimnPgwKnHGpuohQQC1NLGPVzYWRwUCnv7HUe2PJXsNWLHjC/E8V+dalRoDOZkEwxqDTRr2HbOiYx7l2plEr1zCGwzIYTNV9w0ec+A17HJhA5Ht796lfUZSixAwGGGIeOhvZoOorOE8mNUixUuqvbP/iqoz8LRLC4rNK1Wm4WXHc887lCqJ+hKh2FiPlKax8Krmu8EIZDfnPwqZnMDxokkqlauqOCNpY3r7xwuh1ntxL78fT5edbp9pWQ/zcsXQZTatgxFAZJe4InsZ3+pniWpWnCV6gAfYFivUFumX7nM/gnLaw4UoFx14XcuNJOX/bJCHFqKwN46pNImLQVG0UvbekhXKfojjEb4i4fXy5cUqMMfnFnxLwzAST2QlLWuhnAVbTKcjxt/AhCN0ZH8EtC6bWWmBTKuSrc8jDSUDwk+ysCto2ezr1etm4WdrH/F0HICf3WrSrlErdovjq+7FFaJZKIt9Md7uK1FZIDOTg6PbhJ5MK5GsvXdnIZTRm5U3ovSdqQUjNcf/jl/JGvO44+knBRfFFc02O0TrhguJgnmOy0n1M4XDZE2NYu3SHOS SD1FyG4s PHWPXyAUqbdbGN4NmZlp6l7Mb4ZZgMQy4AJdYuWGXEqBlprduYgHIFYUeQrul3LB1MEavO9eAmXikfZnl4bg3GnOoWQ9RyDzI/G0wgYkP6dMB50BC1KoZBjXaPSqAijfQRfsl252KwfYNhwTw9La1y8NQti1lifiM891mL1JREo0Ha5Wy38TNTi86bwflc4Swf2JsnUKdODqCYH7GoEt6ieKj8ZmpnPDRqAO5+9CRzQuHm29Ehxa9Y/WPM52vnNdvod+NmLsxVj/iJzzo7mkWtIWvUg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
hugetlb pagewalk unification
|
expand
|
diff --git a/mm/mlock.c b/mm/mlock.c index 52d6e401ad67..b37079b3505f 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -409,6 +409,17 @@ static int mlock_pte_range(pmd_t *pmd, unsigned long addr, return 0; } +static int mlock_test_walk(unsigned long start, unsigned long end, + struct mm_walk *walk) +{ + struct vm_area_struct *vma = walk->vma; + + if (is_vm_hugetlb_page(vma)) + return 1; + + return 0; +} + /* * mlock_vma_pages_range() - mlock any pages already in the range, * or munlock all pages in the range. @@ -425,6 +436,7 @@ static void mlock_vma_pages_range(struct vm_area_struct *vma, { static const struct mm_walk_ops mlock_walk_ops = { .pmd_entry = mlock_pte_range, + .test_walk = mlock_test_walk, .walk_lock = PGWALK_WRLOCK_VERIFY, };
Skip hugetlb vmas as we are not interested in those. Signed-off-by: Oscar Salvador <osalvador@suse.de> --- mm/mlock.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)