From mboxrd@z Thu Jan 1 00:00:00 1970 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 84840C46467 for ; Wed, 11 Jan 2023 09:54:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EDABE8E0002; Wed, 11 Jan 2023 04:54:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E8AFC8E0001; Wed, 11 Jan 2023 04:54:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D542C8E0002; Wed, 11 Jan 2023 04:54:30 -0500 (EST) 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 C71078E0001 for ; Wed, 11 Jan 2023 04:54:30 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 96BD7AEBEE for ; Wed, 11 Jan 2023 09:54:30 +0000 (UTC) X-FDA: 80342058300.25.1C8501B Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by imf21.hostedemail.com (Postfix) with ESMTP id CBB5B1C0011 for ; Wed, 11 Jan 2023 09:54:27 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ez55A3lc; spf=pass (imf21.hostedemail.com: domain of mingo.kernel.org@gmail.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=mingo.kernel.org@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673430867; a=rsa-sha256; cv=none; b=KqmR2Metp1s3/fMKL1bJpMwrTVTUx7emTVvG+gNAUyZISgZ0qwGVgtuquNfCW7QOsCTzL3 BfnXSy3l1qhMCsTydkx74sdZs4kRrR3fmkCJd5rdlWwutJd8SfU7JKeNzDchcQ9k6agjxx GJNRIxL0o8WaT6IdzEYcUOT4qtSMvZ4= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ez55A3lc; spf=pass (imf21.hostedemail.com: domain of mingo.kernel.org@gmail.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=mingo.kernel.org@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673430867; h=from:from:sender: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=mFXFErf1cq+teYIb8hlzraGgrqjKGOqEZ+fy0lNXo3c=; b=hil8nZdEGJ5kvMhPVvnjZNCr8CEoitJ9fRWwVhzSWAYgaKQLdREX7ODXK/1VAV1UEqb/sJ Iho/ykMSYxcLN6fcS3BtcGBT3HtRUl/aQydqX3HYTUEuGAOKYLgrfxForp8TqR95q+AJsE YpwodQ+ESqzLsV2AB5wlV9TCM2QLfBk= Received: by mail-wm1-f45.google.com with SMTP id k26-20020a05600c1c9a00b003d972646a7dso13914092wms.5 for ; Wed, 11 Jan 2023 01:54:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=mFXFErf1cq+teYIb8hlzraGgrqjKGOqEZ+fy0lNXo3c=; b=Ez55A3lcqCOOEpQ5a4MBkBx/2zChunM795At0TWV11V9WbBJ3DNkEB+66S9HGrtTvn ZDrwYqwzDgMm/GUyX2mzE2EyNcXUbISgQIhYJEFkNsxa/WJWRcmrCKKbqV3CK84/r0Hx gQf3ozUakFu5DN1h0mhXmm1aXmV2UdIPGbHqRzOGvUihTrEa/8iNTkAkHvzMJhamqLTm QEJD46zYp2AUnJ8M0wB+YLQ0S8c8KCU/HRIw8my1jcP70fUUhlXfPYdDdPu4vClkcdjb i8UhuaFbVL7Wq8WsQORBLS3P0UyAc+JZsDHoSzAQqympHQwKCHd983BEMxllkefRdkgp ruvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mFXFErf1cq+teYIb8hlzraGgrqjKGOqEZ+fy0lNXo3c=; b=GiMnt2wAC5ue5elJd7ZPR1/jbUT4+KtDMWqBIwrVIu3dSVnelTjouNfa4NycVCZiBS NM1pOde3+Wy8YgHzR73e4auWpcR/xLx0YscULoqST15JG4/ojhfOsphOJVddZPJqHu+0 hFDeftc1jblEB+qgTnDiK2ux7UsGeIim3se7HJFfE9tx3H3J5lGK1v+imZWw97o58TPb N1HZqfl0xq1MJc8cag3jqdP3aN08ttWjORxpqhIaQE7M60aPjwkA2maNTVdxMmOSHGT0 0gETBRhD4iZNfJ1lMP/WlvVQMh5RDQStkjL9a708hRoeTsZQY702JK6018AO9CTcgW7C H1oQ== X-Gm-Message-State: AFqh2kryIxmTfnLWiwDba2lsSQYecNyHU/NW7E761aKDb8qiajhxJ9db 8rcZF/qgfb/AAT4xNbAu7D0= X-Google-Smtp-Source: AMrXdXs4Bilzbryqesa6Iq2CcbBPhULbeIu/iOoHs0IaVyp+PUdwh0hB46bGVPQijouO6TJpzE7mXw== X-Received: by 2002:a05:600c:229a:b0:3d9:ec70:befc with SMTP id 26-20020a05600c229a00b003d9ec70befcmr9365764wmf.13.1673430866212; Wed, 11 Jan 2023 01:54:26 -0800 (PST) Received: from gmail.com (1F2EF2EB.nat.pool.telekom.hu. [31.46.242.235]) by smtp.gmail.com with ESMTPSA id f19-20020a1c6a13000000b003d9fb04f658sm4077431wmc.4.2023.01.11.01.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 01:54:25 -0800 (PST) Date: Wed, 11 Jan 2023 10:54:21 +0100 From: Ingo Molnar To: Michal Hocko Cc: Suren Baghdasaryan , akpm@linux-foundation.org, michel@lespinasse.org, jglisse@google.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.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 Subject: Re: [PATCH 08/41] mm: introduce CONFIG_PER_VMA_LOCK Message-ID: References: <20230109205336.3665937-1-surenb@google.com> <20230109205336.3665937-9-surenb@google.com> <20230111001331.cxdeh52vvta6ok2p@offworld> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Queue-Id: CBB5B1C0011 X-Rspamd-Server: rspam01 X-Stat-Signature: 1gdfrj7hjoiqd3z9c17n4e6xs6cop8fc X-HE-Tag: 1673430867-207022 X-HE-Meta: U2FsdGVkX1/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etef0EgjYcbuiIlDsmZhQb8tQ1yXE7Yumm04h7ukgu0ybF8fOQK83dXcG9JNYTuK16xOKCRmzBkR8/cqOlYryYx3AkR0C67F4Y1N6OAmFYpUFk6BE954zdkO4c+rOMGkketEWc8wrG5tJUYyVBlUESUiMw/W+k/NpO+S0lHxWo192xe1iQGoHyg12EsLnUyaScrbqQnDm+zIUyHXJmVlJkPabSkSpP32VYvGY0o4YAqFqU5hA7uopk1lOeqJopqbami8Bp+1 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: * Michal Hocko wrote: > On Tue 10-01-23 16:44:42, Suren Baghdasaryan wrote: > > On Tue, Jan 10, 2023 at 4:39 PM Davidlohr Bueso wrote: > > > > > > On Mon, 09 Jan 2023, Suren Baghdasaryan wrote: > > > > > > >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. > > > > > > I don't think that per-vma locking should be something that is user-configurable. > > > It should just be depdendant on the arch. So maybe just remove CONFIG_PER_VMA_LOCK? > > > > Thanks for the suggestion! I would be happy to make that change if > > there are no objections. I think the only pushback might have been the > > vma size increase but with the latest optimization in the last patch > > maybe that's less of an issue? > > Has vma size ever been a real problem? Sure there might be a lot of those > but your patch increases it by rwsem (without the last patch) which is > something like 40B on top of 136B vma so we are talking about 400B in > total which even with wild mapcount limits shouldn't really be > prohibitive. With a default map count limit we are talking about 2M > increase at most (per address space). > > Or are you aware of any specific usecases where vma size is a real > problem? 40 bytes for the rwsem, plus the patch also adds a 32-bit sequence counter: + int vm_lock_seq; + struct rw_semaphore lock; So it's +44 bytes. Thanks, Ingo