From patchwork Thu Feb 16 05:17:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13142502 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 CAC2BC6379F for ; Thu, 16 Feb 2023 05:18:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 629076B0087; Thu, 16 Feb 2023 00:18:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D7F56B0088; Thu, 16 Feb 2023 00:18:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 403C26B0089; Thu, 16 Feb 2023 00:18:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 265EA6B0087 for ; Thu, 16 Feb 2023 00:18:20 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EA047141090 for ; Thu, 16 Feb 2023 05:18:19 +0000 (UTC) X-FDA: 80471999118.22.2AD0760 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf28.hostedemail.com (Postfix) with ESMTP id 3B010C0010 for ; Thu, 16 Feb 2023 05:18:18 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=hDLR1pvR; spf=pass (imf28.hostedemail.com: domain of 3mbztYwYKCO4ikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3mbztYwYKCO4ikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676524698; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=pFZiiTJ1lM5Y9cE9VJMMN6c4zys62lyfuQWFB/SvSfY=; b=LvaVp1kRad5sSGE2tH9WqZF058TAx+MGjqAfO7BzRKanDi9XCbPZqlSqOryONvLB7LSHIR 7gHfcfQpF773njoIOVOyWwOtKRsvj75ETOxu8bLD1lbmCZL6kSRqCp0kZ5gn3B72+8Bpqq geMEu1UoIcmhHFuuJv9z4StYUzor5d8= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=hDLR1pvR; spf=pass (imf28.hostedemail.com: domain of 3mbztYwYKCO4ikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3mbztYwYKCO4ikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676524698; a=rsa-sha256; cv=none; b=W++Mnk3hQRCh+yqGUrE1oJE7tL23vR89XGhNcF+PhaOiESshY08AW5OkAgDRBtPpq1Ty02 5TMyDKri3q5EBuABWDpnHkBR1GT1tow4bG9ThWjCuuJ2eOyRMjuBF1tdDf80nkU6MCB3DD vL+zace32OSoW6qP+J/9VGatNFO1FkQ= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-52ec2c6b694so8315877b3.19 for ; Wed, 15 Feb 2023 21:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=pFZiiTJ1lM5Y9cE9VJMMN6c4zys62lyfuQWFB/SvSfY=; b=hDLR1pvRXBoNPEsd5rWO1uuL2xRvkViIuLxNT0AXT2es+wKEpveR0MayIpEY9kMwnX yKqoPf3/kr2W8U8aZxHHsI3MeVglv4Uuopqy/RZQvDUL+Iw/1b3yNPaW9UiWpFiktEjT IG17SwGNRtI3Tudjcg57P2Pp6pg3eItytQO0663ElsQFpDjPji34Qnzv66OgBFV/+yja uvKllpdQQMscfNlzsu7K4yE4HNqAZ53EkNxV25Op17ac2k06MkhohfLIKcbxFpec+BdV 695/dYeBJhC1TaWGjUDZda/yGXvfwWspsF3C1nfSkAJuqCo5le3F23yvLzWMlOVw2Nnw Ls0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pFZiiTJ1lM5Y9cE9VJMMN6c4zys62lyfuQWFB/SvSfY=; b=IiJgZ2q9QfdpYkevciC5jw8DO8AKQafnrGLXSMFYdaloOVw+5QuwRtut8v4xX0j+D6 t71U9ctd8/S402btQ4BpbFcEmCy7E+IEjjU7ZK0JVZLxGVaPTzNb70qKEdC1DcLMI4Vb ZlvDIBZQo0+cHv1ldeOXzid3QkDcKvh/MDoHfhaxpzaM51NtqOr0zo9dAr3126FABRfa a3oxtT7yIm+JrqoADww8Fvivlpf9HlktQmN6x3wIx/oREphCBj9WHgM+3TRxqvmv41BQ HafEk3ksBsAYWAQ1jRgwSWIJbR+qLnaCPtRWdxpZkG8rTP4Lz2vcGdRTnW0a08Pm8jbV PGHQ== X-Gm-Message-State: AO0yUKVhshljPDR9mimH3pT/lJ3fKoyHYrmDRL0dGLu7WImGd6E1MFBQ FJqnTsYvddci/puHnDokI/f+iIXqkSw= X-Google-Smtp-Source: AK7set/vOsUP0PVWaWbTlqFxALvIpJBlIbMQnTBHBu2Oot2RdkwCU0iTN4oS1VPXE/uz69lz5N2GmOvT6GU= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:f781:d5ed:1806:6ebb]) (user=surenb job=sendgmr) by 2002:a81:9e45:0:b0:50f:f163:7072 with SMTP id n5-20020a819e45000000b0050ff1637072mr442506ywj.285.1676524697322; Wed, 15 Feb 2023 21:18:17 -0800 (PST) Date: Wed, 15 Feb 2023 21:17:24 -0800 In-Reply-To: <20230216051750.3125598-1-surenb@google.com> Mime-Version: 1.0 References: <20230216051750.3125598-1-surenb@google.com> X-Mailer: git-send-email 2.39.1.581.gbfd45094c4-goog Message-ID: <20230216051750.3125598-10-surenb@google.com> Subject: [PATCH v3 09/35] mm: introduce CONFIG_PER_VMA_LOCK From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, paulmck@kernel.org, mingo@redhat.com, will@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, chriscli@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, rppt@kernel.org, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, leewalsh@google.com, posk@google.com, michalechner92@googlemail.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Suren Baghdasaryan X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3B010C0010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1xYKPUZutnjjNj2wVSIZAfVEKBjzuWPtkJ865JO36+PsdZ8kOj70wkS8SBWfn1ZNEP1aD+OlFbb7mVcO+Z5eIjqi80q0G3+LpPPjXUuky3APN6+9LhW01FMBssk1TSMnq7a1119AJwkqhBUIoPseATrS/+kFG301LfmVmUl4ZslqQ2xp9OAM3K8l2+qhvcVb35kzKPtT3kE3kqze8ITu7cKDCw/BG9HXNLbna3bazrFkU6qhIt11qWsz5SKmYbGDbDlfXkhfnhrGVIR9wOI3NdaumXUAPhMGW2licho8Br8T+LR+Wvy/XoR7AkWcB7SDU+tcWD8eFcygYXniEQWggjvIMVeEheyAdFPICFfqfVbholziL324g2FxwpYLr+RKXkX4nKUuQaldaw9onz03QxcsyE7CYwuNAEja5gk4pZJewhBjCkJ8JluNiEGaSlO0w+xVU2oZSATcGeml7CH0+QWRjDeX08Hto6u4iYCtrZEXL6WOsDWzYEHNC4YPeghn6KxEJMUmCuAd2DpPpedBm5Ub0oIXymkOC7SZcgbLTLj/dZzA0v8rRCEHH5rLJPZ2azYJXxOzoHkjRu6KkBT05nmrXR6890zWM6yQN78zAhakf6QyMhfS/eIVVirGqb2MNeUie+T5ETqDMWNkMQzNrb4NKRVQKbJld0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This configuration variable will be used to build the support for VMA locking during page fault handling. This is enabled on supported architectures with SMP and MMU set. The architecture support is needed since the page fault handler is called from the architecture's page faulting code which needs modifications to handle faults under VMA lock. Signed-off-by: Suren Baghdasaryan --- mm/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index ca98b2072df5..2e4a7e61768a 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1211,6 +1211,18 @@ config LRU_GEN_STATS This option has a per-memcg and per-node memory overhead. # } +config ARCH_SUPPORTS_PER_VMA_LOCK + def_bool n + +config PER_VMA_LOCK + def_bool y + depends on ARCH_SUPPORTS_PER_VMA_LOCK && MMU && SMP + help + Allow per-vma locking during page fault handling. + + This feature allows locking each virtual memory area separately when + handling page faults instead of taking mmap_lock. + source "mm/damon/Kconfig" endmenu