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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 5CD13C46467 for ; Wed, 11 Jan 2023 09:55:25 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4NsNMv3vSSz3fBW for ; Wed, 11 Jan 2023 20:55:23 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Ez55A3lc; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::32b; helo=mail-wm1-x32b.google.com; envelope-from=mingo.kernel.org@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Ez55A3lc; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4NsNLv2zCyz3bWw for ; Wed, 11 Jan 2023 20:54:30 +1100 (AEDT) Received: by mail-wm1-x32b.google.com with SMTP id z8-20020a05600c220800b003d33b0bda11so2305730wml.0 for ; Wed, 11 Jan 2023 01:54:30 -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=Ju2f2p+2AVr4a1B/689X4Wk8yy3vOr3Hs3lLzllcp990IRDMUNiH7iZi3xKQ0dg1Cz zdricqF3d6AtcA2vZHHU1Kk+xepzDXtnYvmNNcs3ogMCOeXviBC7fqlE1CuPDQ8xzJV6 kiUivM7dUgO9wz1G93RpqseKnt2wWtwibDAdSrg15pvnAEM7LHA0DiPDrEiTI8pNy/DB xVSLofzV/HDr7Wsp8Nhe24JIUR4hQY+533DVkPWrfCfEcbPGX5LNcrKADatKzCurmosO lSEb0xDSnpigLhqe00/szNlkNXtbvrFvkU7qHjtjQMBLZOrrTj0LFVfZ/TUV4yLQLz6L B/QA== X-Gm-Message-State: AFqh2kryBrsjIv1FDoBa6/ARaJy+UwEbZ+meSJtr9G4wgavyw/46Rw8T 4CbE3JFc5wmBB5dUR2OaEhQ= 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 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-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: michel@lespinasse.org, joelaf@google.com, songliubraving@fb.com, leewalsh@google.com, david@redhat.com, peterz@infradead.org, bigeasy@linutronix.de, peterx@redhat.com, dhowells@redhat.com, linux-mm@kvack.org, edumazet@google.com, jglisse@google.com, punit.agrawal@bytedance.com, arjunroy@google.com, minchan@google.com, x86@kernel.org, hughd@google.com, willy@infradead.org, gurua@google.com, laurent.dufour@fr.ibm.com, linux-arm-kernel@lists.infradead.org, rientjes@google.com, axelrasmussen@google.com, kernel-team@android.com, soheil@google.com, paulmck@kernel.org, jannh@google.com, liam.howlett@oracle.com, shakeelb@google.com, luto@kernel.org, gthelen@google.com, ldufour@linux.ibm.com, Suren Baghdasaryan , vbabka@suse.cz, posk@google.com, lstoakes@gmail.com, peterjung1337@gmail.com, linuxppc-dev@lists.ozlabs.org, kent.overstreet@linux.dev, hughlynch@google.com, linux-kernel@vger.kernel.org, hannes@cmpxchg.org, akpm@linux-foundation.org, tatashin@google.com, mgorm an@techsingularity.net Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" * 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 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 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 B607AC46467 for ; Wed, 11 Jan 2023 09:55:32 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=utzDzH8ixN47hbYRFfjdn+ARVLw9IvoVE72VBDT9E0M=; b=jL77bHSbFpO1kL BYfm6owAnSrUhO90tNjMiuJ/DU9LODKI66cBEZJDA1TMoB5Qh9+WObGUBD5D/NBhzvocEhIo5KIjH /amsrxo1QRdvGNGyiAMAmQIZNrDXAh/hpKI4lfGDMYJn+esud02bE5fBqHswzrouorPWRReSD2nGZ 6VUdnvP96k7kHbL/7/LAcJbCbZ3yf9w9JKrE1JXr9vITKkmSUosuKBgaBb8bZjCsEtZ4EJLSL0MdF peott//jngUiE6zjISFC8yQoljcif1qyUQg1Be+q5AfdzdtdgiEXkrf7Txx8GXtR1Wh3H2IEcb4w5 GEalw8fJnetv/MREaVDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFXoX-00AdwM-2C; Wed, 11 Jan 2023 09:54:33 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFXoU-00AduP-0U for linux-arm-kernel@lists.infradead.org; Wed, 11 Jan 2023 09:54:31 +0000 Received: by mail-wm1-x32d.google.com with SMTP id ay12-20020a05600c1e0c00b003d9ea12bafcso8527946wmb.3 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=yxzxxNvsmwNxeaiWLyEzxZ+kPNpcPfK3gBuHPt4H/LJtr/7k3ULS6F5LRnu3BVrfJi EqD+Dx0aNeZrUVxPV4Gz39hRCQF/6ZR7njbHUIq/il8huoZ2hOH59uEsssjvUmhKb+Ng LiEPwRFIueVdixLYx0mWGWPG4nyN/zrOQgakMKbBcnkCh9ncI3Nqqqy6HbAL1ziNoWB4 up2CZWiAyI7aC1RMGkDLvSkPpHzGKK3IoiZjJQZWLmjS74vPFV+Ak0AWAxUt0qYu4zhX 1v6Q4JL+bh2yYmlR1BsrRuUVEDRsfDZmB9VJ20ABC9RdDaFmkxrKgXb0thqL0W3uSz4e iwQQ== X-Gm-Message-State: AFqh2koUQb8khyQcLHZbHLSroVWgjJsSpj79uFXJFE6j1etA9n2k2ERX eoqSJaR9yUWhMZYRTLMKMsY= 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230111_015430_069696_5CC86EA8 X-CRM114-Status: GOOD ( 26.85 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org * 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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/kyzPAHWItdXJGkGQgcLNCTo3xoKiLi/jAaWM714WmyzoBTZE2diCu4elYUv+ivyT1iwF4VVdAThTDWF8vlhm7NIe+ejuft1RukYjsqq+jslhj4wzOYQcIHNMosAkQ9bXy+4/WlTXP8gX3Kl8wOyMWssGaMc0Q5OWwK4QG2KdtN0BljXJBNmOacrCHVn/VLmb2PV0GqwE4/5jonO8NhfWjI1fbTBsZz3jk7Dy6A8AjEwzyCz2nRNz8us8QqisZpi6ojlSbv7ZyzWdr4Cra2+T1DL+ONlkn2tLbwYYx/2/F21qvIcFgp+L1EsYs3+wQSQx0iCw+jy4OlVtTtktoOGY5teUQnxb9AbzLoTK/dUD1czr33pXb5Q5tnOvScAYAhu/bs6dPLTBqDHJ+uAwOpF/o3tFKshaywgmm5/KU5+6cTWlr6hOapBDpFAspdbIV6R7/a9R0k1AR2yYpdStLzCTNZApKGYkJLhbM+mGJ7hgNK30mu8ApYJUdpMDoXoSZBXepeAt0hPpA1I7hsZm2osIqLOFKxqenR1cdXZy8C61N2PUneW4cSApu6OHgehSfZThZZTktW0OIgEYfTL4qrzCm04nx5Jhv/ThlxUyJkuXHHN9XgoHNOPmK+or0O9jYmQtiVBQWaKLVaIAca8NF6GDpah+4jWwuIUQeSa62jg4FxnwFO6SPI+PyYIZ1n6ecyWtUasEaS3dGT/c+T3k8I1vbRR6HLtCIC/RShNcwEKqGipxMj+2FSJNEPlxqQ+A43bG/SVHWhtX5SMdo0pWOPDBBFhIjmFLydb9QzD7LEpbkwGTeYsTQi0GOoKT/NPmJ+Z5aryPGRrOSzw/d/mNMd871sB9JvDB5p815ev5MqWlBLPD4BpDwr+Q3gVai2LgMMxChQKDjyy9jm3qpt1xHCGfxGQN6wjtWJ3GPVggyyqFThu3/F2aFns8dOcdcAV+5XwXZMkbVngq N3J4m5q5 Ijf3Ux7VjUlkJEAXHpxSgLv/76PJrsC7RAcaz38HV2YQ3zw18JWLFw3JjCO+rbKJrIjGf8Dz9crIJSclVBN6GTLwLryv/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