Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2271052rdh; Sat, 25 Nov 2023 23:20:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGK29gdDDYazIC+ZoS8/+S9REUh0QW1j1sIZEBsXQXMe8YbG/fY7uRj0aTGjTWoiaBk2Ipa X-Received: by 2002:a9d:7598:0:b0:6d7:f9f3:f7c1 with SMTP id s24-20020a9d7598000000b006d7f9f3f7c1mr9923336otk.8.1700983228845; Sat, 25 Nov 2023 23:20:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700983228; cv=none; d=google.com; s=arc-20160816; b=D6VfkChcWFuIB7ROtKqYd2lpAyTU9GH7yY3wa6Gah8cCmNqQ8704gi0FcLQBaaXAK8 iMty6DILlQlLyPiV50Wv5WCgIdcS+IDUCf7hiaA8aocexOuf4HCFxo2NleUbpFjXcaIC iM1+7jz2qHttNAqYVNAZgn2kdpV0AJuRx2xr4776kH8b2L+U7b4qvZpIieymUFP+pOam ueWeh5uUcwpdnj/Bc34XlbbSKEkyosz42HaDLSz7u6I+ZCq+dNeKwvqrD7JQzapyY8Yx ILQkS5BE9j99otdzsPUP+U9dIWjivzYu7uzBroGUwKpAy7FLqA4Xjdc2j1QzFl6YuV9r NmPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sz6pg8K8GFP6G+qtpnGDhTkf/u68i8wZ+eAOQw1z30Y=; fh=jeCy+5iX/aIslnJLubDblI1Uy0iGY015hYyhDR0cDYI=; b=qaMvmLJSAdGHqFAe+ESbf41Ht5674arwbp8Qrp57uZONersOYDdGWHBG17yM1ywyPC NgLVSEnpaYwB9QSoko7b8tpfBHgDWzdnzxbIETgdg5U5UclNbQnV4Pptob5vL9JrzjeL k/xJlzA5p11BWvfovnSWwGad/xjzFKY4QK6Ku389M5kktr78MO4ozahEmaR/l6CVPuQL arnShXEE1mw2qUdVSNwZpH4sAItneca9BcLwIlE86F3SkUHBPUF4b2bOucdYCXXGCb1e 3jJGsyn99fAVxrBcZsBLwmunrxs+TgkxgesHHxng0i+9vY71eEuztUnu309ZOvHcXadw 4m6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=E6NpBQwO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id q3-20020a17090311c300b001ce5b6de761si7334510plh.447.2023.11.25.23.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 23:20:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=E6NpBQwO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5A9898084052; Sat, 25 Nov 2023 23:20:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229594AbjKZHTy (ORCPT + 99 others); Sun, 26 Nov 2023 02:19:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjKZHTx (ORCPT ); Sun, 26 Nov 2023 02:19:53 -0500 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F602101 for ; Sat, 25 Nov 2023 23:19:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=sz6pg 8K8GFP6G+qtpnGDhTkf/u68i8wZ+eAOQw1z30Y=; b=E6NpBQwOV0lra/yPTGN+r 9hqDtNACo7BqnKPbxpYxXOG4TsdMgDuyZ5cLzsyqjndn3mS3YHPVjX+80Myvw643 lTuUHE5ret8pGhoadQ19C65Zlwx58qdYAa1JK+8aiPrNA2CX+KBJKsCewi3hY8+h IoKufxj1AeNBuZwmG9WjGc= Received: from localhost.localdomain (unknown [111.35.185.43]) by zwqz-smtp-mta-g4-4 (Coremail) with SMTP id _____wAXLpde8WJle_b3Dw--.42741S4; Sun, 26 Nov 2023 15:19:03 +0800 (CST) From: David Wang <00107082@163.com> To: liam.howlett@oracle.com Cc: akpm@linux-foundation.org, ankitag@nvidia.com, bagasdotme@gmail.com, chunn@nvidia.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, regressions@lists.linux.dev, surenb@google.com, willy@infradead.org Subject: Re: [REGRESSION]: mmap performance regression starting with k-6.1 Date: Sun, 26 Nov 2023 15:18:54 +0800 Message-Id: <20231126071854.19490-1-00107082@163.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20231123143452.erzar3sqhg37hjxz@revolver> References: <20231123143452.erzar3sqhg37hjxz@revolver> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wAXLpde8WJle_b3Dw--.42741S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7KryfurWUWry5KFy3Xw1fWFg_yoW8uF13pw 43KFnFyF4fJr15Xr1UCw1UtF1UJw4rtw1DJw17Kry0vF4DZFyUJ3W8tF40qry7JryIgr18 JF4UJw1rXr1kXw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U5sqAUUUUU= X-Originating-IP: [111.35.185.43] X-CM-SenderInfo: qqqrilqqysqiywtou0bp/xtbBnBE0qlghlnqv7QAAsE X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 25 Nov 2023 23:20:26 -0800 (PST) > What this gains us is the ability to remove contention on the mmap lock > during page faults. If you were to test contention around that lock, > you will see a slowdown until you reach v6.4, where per-vma locking > started to show up. More benchmarking will show different types of > fault handling outside of the mmap lock until (I believe) 6.6, where > most (or all?) types are supported. I add memory access between mmap and munmap to the simple stress, and timeit. Following are the numbers measuring total system time for 10,000,000 rounds, it is not very good for 6.7.0-rc2 (The delta column is just "page fault" - "no page fault", roughly the extra time needed in kernel to deal with page fault, I guess.) +-----------+------------+---------------+------------------------------------+ | | page fault | no page fault | delta(kernel time for page fault?) | +-----------+------------+---------------+------------------------------------+ | 6.0.0 | 64s | 13s | 51s | | 6.1.0 | 104s | 49s | 55s | | 6.7.0-rc2 | ~210s | 67s | 143s | +-----------+------------+---------------+------------------------------------+ Maybe there is something here needed to be tracked. My test code now is: #define MAXN 1024 struct { void* addr; size_t n; } maps[MAXN]; void accessit(char *addr, size_t n) { for (int i=0; i