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 4A9C6C54E76 for ; Tue, 17 Jan 2023 18:34:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E401B6B0074; Tue, 17 Jan 2023 13:34:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DF0EF6B007B; Tue, 17 Jan 2023 13:34:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDFB06B007D; Tue, 17 Jan 2023 13:34:38 -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 BCE036B0074 for ; Tue, 17 Jan 2023 13:34:38 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 954414056A for ; Tue, 17 Jan 2023 18:34:38 +0000 (UTC) X-FDA: 80365141836.19.B184F73 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by imf01.hostedemail.com (Postfix) with ESMTP id 110CF40008 for ; Tue, 17 Jan 2023 18:34:36 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=poslRgeb; spf=pass (imf01.hostedemail.com: domain of jannh@google.com designates 209.85.166.43 as permitted sender) smtp.mailfrom=jannh@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=1673980477; 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=WQstPUbztcQ3oNJU/jnXWE9GGqVn0CTYXvJ///cN2gs=; b=iVXyYhcM30jT/wpBUF9dfUGCjKCwtZrTQLKWkUq61esDcDX+j4tJ6TmntJYn7qjnXk4oae FTaRAkoH3X/TDGWhyYHsq4ptTcyKFx6UCGp9Cz1tMR7QlFPIXJc/PH5uYEJApQ+/AFGOoX 0IbF+ZCljtZaD2923CV9mnBcyaANiLs= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=poslRgeb; spf=pass (imf01.hostedemail.com: domain of jannh@google.com designates 209.85.166.43 as permitted sender) smtp.mailfrom=jannh@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673980477; a=rsa-sha256; cv=none; b=0Sy0Qw+ewcwjYvxo5lf3erPEJ3rl6rIIQhMNGsIEL9ZG0C4pP49UhotQuGFEbxO64hKdA0 ZHHxaHBxgV1TVUHUEJZE+paIzFMjeDQ6W5hJiitlgMeJ71VAfjDlI4X+BTK8OaLfn9fJkp JaUfZ3VbLBZABN+x0eApw/okLCR0uHQ= Received: by mail-io1-f43.google.com with SMTP id r71so6333932iod.2 for ; Tue, 17 Jan 2023 10:34:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WQstPUbztcQ3oNJU/jnXWE9GGqVn0CTYXvJ///cN2gs=; b=poslRgebD7N051xL0dlQ/s+Ezqw18K2i/MiyhjW69tD8Q8EWVF96k5wFPqBT68fIx4 UW+FBcvboauGVEVYcGOYlMCrKMALhEZA6FzdBO7hQ/yy98POithKQbpUgSoBLfCQX/0/ mJFhqGlui74HddUG5gvjSzhjV1UFMflKwN3ojHD7sq+Of/9IGSYd4RX0Bny2aHq9T6kz t/LR7AstaK1J+f+cW7PCcQlb6SZ7W7jpqeEYhVrnXFbSmdgrsuHVjXiM0XSUrm5lu0IF OLrxwCiYBNX5chzmqbr8AiRTqv2U25IqwvgeRrbnbHsVx3+eSncfTAhX20VyHDelBId/ G6rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WQstPUbztcQ3oNJU/jnXWE9GGqVn0CTYXvJ///cN2gs=; b=jU8TxfsswHyDF1QIWe+H0S0fQ9oAj3KrFPf9iOv7hwJzrtoRZ7l98C8SWTD5LqoP3e ARZBp/idlnhx8P3EvRXVFPRjpc5rnppgKNYLEZp+QM2uuRgezH7qkjlZga/5ccrhcGnU Urpuu3Cegu6nUKLnF8C3jSk/Hz/e5UKxGioJkaULKqsmgTRrZYT3plbbfnC2xthLpO/S eBgOMPW1CzDJ7DdpQyIh8MtdDYGrShcIjPfLPLPxxrwzLcAd1OEfkM5T1h5M8i92RDdY 0M9/TRMPS2RuDDU9deVlSgEn93W/u9DQflUYx0f8AycXP4DMPJUAFgRgf1FL0BmgJILl YkZQ== X-Gm-Message-State: AFqh2kruM36fEqc5XqLBH2f8txgQ2qs721iG9oO/oEzbbsiZ1mSJbtHS 8xZPuLlbN/6rbnmenf6vsHyKxfPlyahSgt39hVc/yQ== X-Google-Smtp-Source: AMrXdXvKN7wlexSy7gop1ACSgNR8UjrskPXnJONDdTkzOd0szS0kK6a+OFW7XqVKezwp7mdwKsCdCkJZHIHSfB+9s1E= X-Received: by 2002:a02:aa99:0:b0:38a:49b8:bc49 with SMTP id u25-20020a02aa99000000b0038a49b8bc49mr335554jai.66.1673980475940; Tue, 17 Jan 2023 10:34:35 -0800 (PST) MIME-Version: 1.0 References: <20230109205336.3665937-1-surenb@google.com> <20230109205336.3665937-41-surenb@google.com> In-Reply-To: <20230109205336.3665937-41-surenb@google.com> From: Jann Horn Date: Tue, 17 Jan 2023 19:33:59 +0100 Message-ID: Subject: Re: [PATCH 40/41] mm: separate vma->lock from vm_area_struct To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, 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, 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 Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: bnitar7z4smz143ui4gjuy5w37z7fgkq X-Rspam-User: X-Rspamd-Queue-Id: 110CF40008 X-Rspamd-Server: rspam06 X-HE-Tag: 1673980476-811096 X-HE-Meta: U2FsdGVkX1/Ru7WQDuxnY19sKaJ7MprECOgK2qpIiaesWUrUreCzB/KMo0SYFVBp8Eg1RwzHTKUHTa9jOkOAz0UCxN6Qr5t45exo4bQjVO9KK3AfMkOMEIQxIT9wBoKW9dJaWTwOpP7fZzW0rU0gNu6ib5F0GyIqbdOeW5sxiLXhFwF8hwBv16jgcMCFBOZbxZ7bG0GckYwgl0clZeehT8M/hLfsT6p5/7XO0IIG8OeW5Xla9x62tPAJ+ChqBUgX2K2gxnIdQJwkDo15o4AKSRb40ZP9SJyrIrulFkmowd/eV+QKmO0+rqCICLJiKjI6KeYnhhKYlG7+myFDXbFmvfs0t0nGdpp3ltoTFTSF228ae5lW7iyktGlji3oTvUBI2XvGapchLR4qgS3YVlbeV8Q6TFvI0l4J4N/0l0Cji/eyklniIaoJ82aqz0Bg728zW1FXpC+p3+mqea0IEdcWVUCc/vOHF//FTD47iOCvkUAgfn2CZ6xa5VgqOgms5U9LGOcdyv3CurOwK3s30Jt4uRgPzNJ254LZNAcmNagXsboaph/rJgfqqVmglaVFXnJRr8nLnXGNF/C287aegiGLU+ZIvE82xYloJ+xIa3zPZxojSSpbWWnj0EI7JFjQUWv59N+nswAkXw18tPglAoCVe05v4fqs/M6zo0KRw91dFmim+hyeNwqTF8M3M4LWXRD7YWPUad8XaeWn+kFsblz9XL+T/ksrlZXf9hk0sjhszle895Sew5pNTJ/uUMYvCLSP8oX0tXV3jvmvUoE4b2MQ9LOLSKEZSlhJMD6aAPOTM+gEIdw0UaJAnJiKxDZTR+xzx9/pEpsCNvvmIJkmPMSuPu8in6m3RRAS3vAc4HrG2yucPFdICzuPuNTLa6zzP5CU9csqSpcn1nuqxY+kGixJah2qYbErlhbnZnJ+o0n8Mt6iAXokb693YFZ5hgpv084zglg/tWWyHf/wJaF0OpM TPyAT/E0 YiShB6J1tV0NjYjNg0VraYk1ze504M9pFRnxGZgLJZVZlKdHs64V+DaN2fQ== 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: On Mon, Jan 9, 2023 at 9:55 PM Suren Baghdasaryan wrote: > vma->lock being part of the vm_area_struct causes performance regression > during page faults because during contention its count and owner fields > are constantly updated and having other parts of vm_area_struct used > during page fault handling next to them causes constant cache line > bouncing. Fix that by moving the lock outside of the vm_area_struct. > All attempts to keep vma->lock inside vm_area_struct in a separate > cache line still produce performance regression especially on NUMA > machines. Smallest regression was achieved when lock is placed in the > fourth cache line but that bloats vm_area_struct to 256 bytes. Just checking: When you tested putting the lock in different cache lines, did you force the slab allocator to actually store the vm_area_struct with cacheline alignment (by setting SLAB_HWCACHE_ALIGN on the slab or with a ____cacheline_aligned_in_smp on the struct definition)?