Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2215427rwo; Thu, 3 Aug 2023 06:29:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlFOCAu1wHMF6qXI1kOK8OR8X/PLZqM7YGEtyBdlZhUvY9lrpVc9+SykLW6Qrnq7IChbMZTO X-Received: by 2002:a17:90b:23ce:b0:262:e589:678f with SMTP id md14-20020a17090b23ce00b00262e589678fmr24988818pjb.10.1691069366173; Thu, 03 Aug 2023 06:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691069366; cv=none; d=google.com; s=arc-20160816; b=DSw6OX/bFMdsi1qZrz4dKmxgbaWC56FLUMktljTju9StgkKHAYJExk34hXVt3ztrz+ MqxvrDOdY4U9PewuMariyktVbFti4wm+OSf0hz7jqpROB4+13vhqrF5mmoVPr3EbfRvj MRRBJ6ZhceN0jHFV6TvzFt9q9Q27k6FOOiPPBP86T0ysqwRG6oXFzckHTzRuXLF0ZG3E jW4Rc5DTz0AR8E08V7G8eFWtVrCCs9XhNli99WbV7hp9pZY40uZfixam9tF9+Oqlyigo VLKtCGh1OUet+fYjKLOG8XqMGGReNXh0yp6Er6355VSutbZH2NkFb+yiVW8XPIL8Xq3G Cp0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=Qa7yIYyQghYAhcOFBDaKNarj96s/PZk7WSoWRLHnKMU=; fh=ADTR/5GPT7KBykd2R94oJZS+dONeZv9Jd9THG/YEdtg=; b=Lhr0Zwwg1wWmVwVATq4mWYW9MCA7ZZai0oDwQ7nb5lNDxEzLgk5YeTiiIumW0PWmuC vDhuKe0lpX2L8+ejw2k0DV2k8HqE7MAV6AxqlIY8mBOokCY/8eDTYoZPugor/E2Vmomb pxH6YhmhnEbJ1QTwhlbJEt5l3+nGnmcZ2BuxDmMB5jLjo/wU/us8Bj9PVe1wFWaDrSnY +Uk3DyVQJDYJ/kMFzfpnNfOWAXyChwjafInmqIWyuRF3FLWr2Ua5hFILindhLy3uAzUy 8bXuRZgN0zJ0EkXQ5yGEFSmonb2WcOmyKoj5Zc95RC8uIZFtBqs7gRlsRTBK5+gPBqN6 m3Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f22-20020a633816000000b0055731c5ee5csi10568720pga.902.2023.08.03.06.29.14; Thu, 03 Aug 2023 06:29:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235014AbjHCMsz (ORCPT + 99 others); Thu, 3 Aug 2023 08:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232519AbjHCMsx (ORCPT ); Thu, 3 Aug 2023 08:48:53 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0DE033586 for ; Thu, 3 Aug 2023 05:48:52 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 78F26113E; Thu, 3 Aug 2023 05:49:35 -0700 (PDT) Received: from [10.1.35.53] (C02Z41KALVDN.cambridge.arm.com [10.1.35.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 964493F6C4; Thu, 3 Aug 2023 05:48:50 -0700 (PDT) Message-ID: <2f3a4ab5-dea3-deaf-6f6d-01ac4a5716b2@arm.com> Date: Thu, 3 Aug 2023 13:48:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v4 0/3] Optimize large folio interaction with deferred split To: "Kirill A. Shutemov" Cc: Andrew Morton , Matthew Wilcox , Yin Fengwei , David Hildenbrand , Yu Zhao , Yang Shi , "Huang, Ying" , Zi Yan , Nathan Chancellor , Alexander Gordeev , Gerald Schaefer , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20230727141837.3386072-1-ryan.roberts@arm.com> <20230803120100.2glxdc4yf7sjn7h5@box.shutemov.name> From: Ryan Roberts In-Reply-To: <20230803120100.2glxdc4yf7sjn7h5@box.shutemov.name> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/08/2023 13:01, Kirill A. Shutemov wrote: > On Wed, Aug 02, 2023 at 05:42:23PM +0100, Ryan Roberts wrote: >> - avoid the split lock contention by using mmu gather (suggested by Kirill) > > [Offlist] > > So, my idea is to embed struct deferred_split into struct mmu_gather and > make zap path to use it instead of per-node/per-memcg deferred_split. This > would avoid lock contention. If the list is not empty after zap, move the > to the per-node/per-memcg deferred_split. > > But it is only relevant if we see lock contention. > Thanks Kiryl, I understand the proposal now. Having thought about this over night, I'm thinking I'll just implement the full batch approach that Yu proposed. In this case, we will get the benefits of batching rmap removal (for all folio types) and as a side benefit we will get the lock contention reduction (if there is lock contention) without the need for the new per-mmu_gather struct deferred_split. Shout if you have issue with this.