From patchwork Mon Jan 9 20:53:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13094341 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6DB71C54EBD for ; Mon, 9 Jan 2023 21:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=PuZDowQv3KpwJMNfHTElUl0UcwcObLWGHT3YF38nS9M=; b=DVfp6LBpFFHFB4rXkVM/wKxo/i +LKNIIEDO9Fmfml6YAPj+Aorc5C7wpgkMi6LPSNeiW/O/n4400ngeSlxjrP+IR/Idsh8HxLL/Z5D+ W/pxsiGVyczxOaaWWjz4gLkbSbN9zKfHF1mipL0Bwe+roExl6YMf96B5a2ZbfOSZYia6pLzWYwjoN yIut/nT/aSGtW7ezoQZ2dgvb0Whd17TltGT6nDySoq77FSGH1XO8eyHSC16PL3ldRNu6kSpnkTeFD QGPtS25A6ohohmYhvEykZ1gDg9BRwsEuaYOmmG08fun7zKiO5IMfMvaUiRDpj28Jw6fTVOSDpfyGQ N/Gpvy3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEzUR-00492n-SH; Mon, 09 Jan 2023 21:15:32 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEzSo-0048PJ-8Z for linux-arm-kernel@bombadil.infradead.org; Mon, 09 Jan 2023 21:13:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Cc:To:From:Subject: Message-ID:References:Mime-Version:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bU2TYXI/IQ+ahWPrvtMjvIvPP35LcWsiAJFQ60YWV8o=; b=UL9cjJho/KkVji9a8Is4ewXMib Pr0GEHuBg6sHbG7uNWMFRp5mxhhuZymWBOJkgS2NmpK1BF4bX+WZqgfldGOHLSaPksoYSL63zBWOx tXRhTLWaS7aD+syd6UtuFJr4mgIJD49ESuCpGXIuQ3jFMBXUGBTLmdcpUt12lif89IrbxXEZTHwVI GnSyw2uriXrZgV824xGOLORvwL4Ckh4tf5eGSQa4oV2bVH3ApdH7UwUB78vhaMYqLeOldjPaysnNE oAF+W2BZMUHfNswEn8NKnWbHTbEs4+VNimL4VYI3xXyT4tvdYCqBhOWaw0sse8aeP+NejGxb5EqbQ 5WOP6ZTA==; Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pEz9d-002sqb-0G for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2023 20:54:06 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-4755eb8a57bso104725297b3.12 for ; Mon, 09 Jan 2023 12:54:02 -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=bU2TYXI/IQ+ahWPrvtMjvIvPP35LcWsiAJFQ60YWV8o=; b=hJQlgWQOwjt9bdNS4iNCFQHGlLFypCJo9NibsA7lH+Cj66pCbZCU+CxVh9F7A2fm7T vmlH3bAYg1kSOc6vTNCehxfbrsiSwMkUwfklPcXaZBTBOgsQNuQ1lURfneHqEpASj7ak 72wsJeHj+71ppFuT3bry8xcf97dMVhsy87IzDxduellVAKg7BiJc4vIK8HA7ompTnbjq +gURuiw11LvdH0ad+L6DkctzinvpOQbzYQIPe9DQz0Et4Siymb/UJSUp4isr8x/TUfSb z+/96aen7RzYU/fA94YBNLJOwTLnQ/SBQCaJx176+XVEeqKe1Aaxg+5hL1pkiSz0xMHc S9Jw== 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=bU2TYXI/IQ+ahWPrvtMjvIvPP35LcWsiAJFQ60YWV8o=; b=u41ARgMuTK2oeaEykHgs6m5jiNBSrQqZexZfkF6Ugksc0QVLJEBneat3GLfkbJ5NFR gPJcGL0WwxUKQbaO02CRE3BM4igiS+swPpanrAarZVWNH18Kd99MyRvK9eL20GD+Wg7x py+0PMT0Mi3soT785WyVw3icY8kAG4QMy2NM4MyPzxWeu5rZTRFYjS2oxGZyvwjA7kPR IXrcy2WR4Pl1rP4ehUZUWsUM8Q6/9fITiwlyrjNEOuwj9CzHBBV1H8MXx1QOWZZwg1J6 xFQO4QqdODZa/qgSIOmDCnJ90pj4n+OIe9WJg5GD5lU2+wh/79tL6rxHQJDnA/41joWw 94Jg== X-Gm-Message-State: AFqh2kqULnxp65mIVTK/pwCwmj9hOjpfwEkkyHjsxV8VmMjSptTTgI/k wJTv2D4kSaGAFmA+Kp9TryB2j2RT2lA= X-Google-Smtp-Source: AMrXdXt3ngSzeTd4BjcWtYkKZUmKlJ+coRJjsu8zn30hseAAXL6r6J79qyIJjR/uVl5OkeApgAgECG74aLI= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:9393:6f7a:d410:55ca]) (user=surenb job=sendgmr) by 2002:a25:9f8b:0:b0:705:cde7:2363 with SMTP id u11-20020a259f8b000000b00705cde72363mr8137319ybq.81.1673297640913; Mon, 09 Jan 2023 12:54:00 -0800 (PST) Date: Mon, 9 Jan 2023 12:53:03 -0800 In-Reply-To: <20230109205336.3665937-1-surenb@google.com> Mime-Version: 1.0 References: <20230109205336.3665937-1-surenb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230109205336.3665937-9-surenb@google.com> Subject: [PATCH 08/41] 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, laurent.dufour@fr.ibm.com, paulmck@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, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, hughlynch@google.com, leewalsh@google.com, posk@google.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, surenb@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230109_205401_344402_9611D7D9 X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This configuration variable will be used to build the support for VMA locking during page fault handling. This is enabled by default 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index ff7b209dec05..0aeca3794972 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1183,6 +1183,19 @@ 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 + bool "Per-vma locking support" + default 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