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 6F0DACD11C2 for ; Thu, 11 Apr 2024 00:20:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1AEE6B007B; Wed, 10 Apr 2024 20:20:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BCAF76B0085; Wed, 10 Apr 2024 20:20:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A93F86B0087; Wed, 10 Apr 2024 20:20:17 -0400 (EDT) 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 8B7A66B007B for ; Wed, 10 Apr 2024 20:20:17 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 25BF91409A5 for ; Thu, 11 Apr 2024 00:20:17 +0000 (UTC) X-FDA: 81995344074.24.BBD93F5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 6EF5214000C for ; Thu, 11 Apr 2024 00:20:13 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Gp0hDiaS; spf=pass (imf09.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712794815; a=rsa-sha256; cv=none; b=wCghEWP2TEF+kejh0YCF+p/UgKJ2gzTAUturTAViY1KmtoBTSI8eXVmp7lotdfYgOnZ3qP SxAO4xFBAijO0UZkNaCovKduxaEchinxA9T9MDbx2qrbbBjoR1lUkTOc1Uu0tSQbID+4/g /pU/bPh0s3jEZGjt1t9cUMarc7mw5Rw= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Gp0hDiaS; spf=pass (imf09.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712794815; 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=XW7lRdMaw49DZlorZ9rEchurtH6In5AXgWpUcaiLQ0E=; b=DsyHg95krvOCdhPIKqumU4UZhl5rTLOKPBGMyWqjKUyrKc1Bvcyfdx2Vl0jT87mENZ2E6W Oo5B79UynsQR3oDyGDV4BTV5Jl1PNXl+SkI5zK/j3J9pN3MLJbxgYkUzPwIhLqCSmW3pTb brpwV/2fz9zDAec+y/5l5IJB17P6698= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712794812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XW7lRdMaw49DZlorZ9rEchurtH6In5AXgWpUcaiLQ0E=; b=Gp0hDiaSFQrTXPjtNTnGat/PlVciWkFTtfqCz5e1oO9HaJKmMvZ+NFs1yixdkSMdVUFDHX EUs1x5vEfIvethHEBw9hXMROi0afH/haZev5kzZp4LwCXTNPKV5f33OQH9rUz1HHodXkBf EL2E+1zzCzjnh/vCaK8aMzactWsERgc= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-269-xYsnSyorMma2F2hdaPmBvA-1; Wed, 10 Apr 2024 20:20:08 -0400 X-MC-Unique: xYsnSyorMma2F2hdaPmBvA-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-69b147e856aso15958826d6.1 for ; Wed, 10 Apr 2024 17:20:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712794808; x=1713399608; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XW7lRdMaw49DZlorZ9rEchurtH6In5AXgWpUcaiLQ0E=; b=km4h2EXE5u6d19BmK13vanekfN8RPGmcGRJLFbUY29puh9O8w7kNMsduAftAJUi4g9 hcSAsgCmgJoxI2nQ6tciiso8upl+fNS79z0fNL9lxgbMg+yMfzYJwQvUGYxd4CteE2Mj 1ibPGNxXksv9VE99H/8iatTy1UHYC+s1rfZ0/tFx6mTkJnjrkK+wKnxntqMiNN7LQ/vd MYWm3dWIRLGmKZMBpRfmPxEeof/sJz9zmnxl1IhUHjesgSHs7VdwDD9bGUEj9bWzz0Bv Y+6S692cy2oEjtmQcDb87rlP4SkauHZ/OCdx4JMRap+4cO+6l7/AJZ3rE1vodCr21cmU BLOA== X-Forwarded-Encrypted: i=1; AJvYcCXZnEQ7wqfxgSmwceZGCYE5N8vFLGwRe+4ZoeSTR83+7C1ddfzH8Nk0BpsDYxFBuJCXDWi0S0UkRqiqfzx9lLedFsQ= X-Gm-Message-State: AOJu0YzH9weWGL0SOczmBueXSEQq5cTuXGjTBAUQ0Baen4aqDEXDaupF ayMtBSDqO3XylF2rri13gpkAZUE8zObBksBSScBQPvwuL4pkKVeIzhpzCVx69JCxhss/yoh6cKG L8US7Hq3Y7QdBFBVAUnZSVaFW6XgG3tej+8rGXUTKXb9EYIpF X-Received: by 2002:a05:620a:2a11:b0:78e:bd2d:173c with SMTP id o17-20020a05620a2a1100b0078ebd2d173cmr2006286qkp.1.1712794808023; Wed, 10 Apr 2024 17:20:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUsAzWUcIZoiDeMpE848/lveSpzZmlHz92Aa5PXkLq+ZGgz5DO21Z/mblLyjSYoBpkBxm5Lw== X-Received: by 2002:a05:620a:2a11:b0:78e:bd2d:173c with SMTP id o17-20020a05620a2a1100b0078ebd2d173cmr2006260qkp.1.1712794807341; Wed, 10 Apr 2024 17:20:07 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id pw5-20020a05620a63c500b0078a593b54e6sm255620qkn.96.2024.04.10.17.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 17:20:06 -0700 (PDT) Date: Wed, 10 Apr 2024 20:20:04 -0400 From: Peter Xu To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Suren Baghdasaryan , Lokesh Gidra , "Liam R . Howlett" , Alistair Popple Subject: Re: [PATCH] mm: Always sanity check anon_vma first for per-vma locks Message-ID: References: <20240410170621.2011171-1-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6EF5214000C X-Stat-Signature: m1t16we7hcas6rjpqpemytqd4s73iik5 X-Rspam-User: X-HE-Tag: 1712794813-76819 X-HE-Meta: U2FsdGVkX18TMtOJbmRhMFXlcb9UMNtqW7iMduStM0qauNQqgKik9X1JbCYCBLfDtLc7kBdOyBGULAFI6V9V0uo4uvA7UOxHuZjIUGdtDp6oFYPEA6Gi6OvFlDITN+kb2T0ELnkY7Xhs44HyYpAXEtJ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U46zaUX41wjTOpXaKtzjZfF33Cgou8a8AC7ESmSZBMBNP4TYaqOWNRU6FXNmOtXKrkfG6n6rZjsyA3J/cn4ea+ryvMytN4Na8NzQAwDpJwEAIhMmSfsQWyLJRH46N1kKxdjbb0nh3FVBT7ARX0E+8K2DylBMEvewdhY+qFwbax+jeFlC26KM X-Bogosity: Ham, tests=bogofilter, spamicity=0.010066, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Apr 11, 2024 at 12:59:09AM +0100, Matthew Wilcox wrote: > On Wed, Apr 10, 2024 at 05:23:18PM -0400, Peter Xu wrote: > > On Wed, Apr 10, 2024 at 10:10:45PM +0100, Matthew Wilcox wrote: > > > > I can do some tests later today or tomorrow. Any suggestion you have on > > > > amplifying such effect that you have concern with? > > > > > > 8 socket NUMA system, 800MB text segment, 10,000 threads. No, I'm not > > > joking, that's a real customer workload. > > > > Well, I believe you, but even with this, that's a total of 800MB memory on > > a giant moster system... probably just to fault in once. > > > > And even before we talk about that into details.. we're talking about such > > giant program running acorss hundreds of cores with hundreds of MB text, > > then... hasn't the program developer already considered mlockall() at the > > entry of the program? Wouldn't that greatly beneficial already with > > whatever granule of locks that a future fault would take? > > I don't care what your theory is, or even what your benchmarking shows. > I had basically the inverse of this patch, and my customer's workload > showed significant improvement as a result. Data talks, bullshit walks. > Your patch is NAKed and will remain NAKed. Either would you tell me your workload, I may try it. Or, please explain why it helps? If such huge library is in a single VMA, I don't see why per-vma lock is better than mmap lock. If the text is combined with multiple vmas, it should only help when each core faults at least on different vmas, not the same. Would you go either way, please? For now my patch got strongly NACKed without yet a real proof. If that really matters, I am happy to learn, and I agree this patch shouldn't go in if that's provided. Otherwise I am not convinced. If you think data talks, I'm happy to try any workload that I am in access with, then we compare data. -- Peter Xu