Received: by 2002:a05:7412:85a1:b0:e2:908c:2ebd with SMTP id n33csp107752rdh; Mon, 30 Oct 2023 15:41:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDgh/PcxImfnDAoJN2qSNxc2It5judR7JYLz8Tm2rgOcMXZAzZJ7+QxyuZVXEFKqHD1g61 X-Received: by 2002:a17:902:cec3:b0:1cc:5671:8d9 with SMTP id d3-20020a170902cec300b001cc567108d9mr1086760plg.27.1698705706009; Mon, 30 Oct 2023 15:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698705705; cv=none; d=google.com; s=arc-20160816; b=fhuirH4NbWxZzZ3Jw2nhkdXdSwsazNVHfTx4oS68PFS3lDK65sPhtkpgvjC+eUamiW LH4I6ZGF0rbE2rj47RvcJ+AgMIbyUaaMpkhX2h1m6qyHbk/fYtSo08wDAJUwho2Zog2e caP2nQMYWlX0OsUbzPj7lWFRVfWdQFNXw57QhgKPyJC0QFl0Ztc8P07jgPdelmWI9K19 +O858ViQaq09SpbcBtRe5oI6UUFurdOOI69zSSWvVDPhgoKSH5HzjrkiSapK56YEseyX xyF4qhrEhMHJukcpGDOk2Bvwq8YOFX4uwqbTOOjctrSoTwvqE9nz9gnTlq/fzAjxtIzP pNlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ydo8vpz/0C3fYwld7DbnpxKY3nhkkeImLsIwB2cJ3jQ=; fh=LXo/dTBxomZN0BRgZ/M0ar16GlIizE/cJ6nn3rAnoNY=; b=JhKXH9WO6yoRY8qkCrl+JmdSeOxQ/Huya7m+WN6be3zvHZgc9eAF0Wk5V/4zbeYFct /K38ulg1HUjYrjxDKXGGU+7S4vqcTvHi/QsJc15BwRP8rgZwJCHRZpcj/yA2Y+dTz3En 6dlWRsdWWIu0OgBJ0UjlEaa4yw1rLljJrsQzIg2qT9SnyFP6/HaXtfrO6er9fpiBddSn I4EJchjQNU3U7C8iIfNFUThCq2BXfPtS6c1G/AX+uxrJewdO/7OPt0dS+Gog/HcB/I9s 7Ax45Ws6MyjeVoFqH4sBafBjTD+bmgeX+NJJ4r7P8mm1SRY3VH8t2FnbsH5aaL76+5x9 4eng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x5-20020a654145000000b005b92a5860besi79673pgp.885.2023.10.30.15.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 15:41:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 55EA5807C857; Mon, 30 Oct 2023 15:40:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbjJ3Wku (ORCPT + 99 others); Mon, 30 Oct 2023 18:40:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229672AbjJ3Wkt (ORCPT ); Mon, 30 Oct 2023 18:40:49 -0400 Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 817CEC5 for ; Mon, 30 Oct 2023 15:40:45 -0700 (PDT) X-AuditID: a67dfc5b-d6dff70000001748-b0-654030eb2bf5 Date: Tue, 31 Oct 2023 07:40:37 +0900 From: Byungchul Park To: Nadav Amit Cc: Linux Kernel Mailing List , linux-mm , "kernel_team@skhynix.com" , Andrew Morton , "ying.huang@intel.com" , "xhao@linux.alibaba.com" , "mgorman@techsingularity.net" , "hughd@google.com" , "willy@infradead.org" , "david@redhat.com" , "peterz@infradead.org" , Andy Lutomirski , Thomas Gleixner , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" Subject: Re: [v3 2/3] mm: Defer TLB flush by keeping both src and dst folios at migration Message-ID: <20231030224037.GA900@system.software.com> References: <20231030072540.38631-1-byungchul@sk.com> <20231030072540.38631-3-byungchul@sk.com> <63C530D3-3A1D-4BE9-8AA7-EFF5B895BE80@vmware.com> <20231030125129.GD81877@system.software.com> <0138328C-74D5-471E-A2CC-7675CA692F42@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0138328C-74D5-471E-A2CC-7675CA692F42@vmware.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMIsWRmVeSWpSXmKPExsXC9ZZnoe5rA4dUg3dtKhZz1q9hs/i84R+b xYsN7YwWX9f/YrZ4+qmPxeLyrjlsFvfW/Ge1OL9rLavFjqX7mCwuHVjAZHF910NGi+O9B5gs Nm+aymzx+wdQ3ZwpVhYnZ01mcRDw+N7ax+KxYFOpx+YVWh6L97xk8ti0qpPNY9OnSewe786d Y/c4MeM3i8fOh5Ye804Gerzfd5XNY+svO4/Pm+Q83s1/yxbAF8Vlk5Kak1mWWqRvl8CVsa1v A3vBea6Kn5sWszYwbuboYuTkkBAwkWjfeZQNxv7/ZB87iM0ioCrRdfg/WJxNQF3ixo2fzCC2 iICixKH99xhBbGaBd6wS3z9pgt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CMmkBI8sqRpHMvLLcxMwcU73i7IzKvMwKveT83E2MwBhcVvtn4g7G L5fdDzEKcDAq8fBu6LFPFWJNLCuuzD3EKMHBrCTCy+xokyrEm5JYWZValB9fVJqTWnyIUZqD RUmc1ys8NUFIID2xJDU7NbUgtQgmy8TBKdXAuDbvb5rBggW1qzSPz/9lIBi6R2NpWmwik+iM o6YMis3yWZ1XdR62CE65uvbzvppjsgam282+zJRu1T58nzUm6m7xzGXSNpXCy7gqtk3TWrZn ouTbR1MuLi57E7Jywsv8nRLTH8UvjzvIbnqWy2LGfqcf969VSim1vLIqCVlUt/mP87eJe5dd eKnEUpyRaKjFXFScCACyQ1lNvQIAAA== X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 30 Oct 2023 15:40:52 -0700 (PDT) On Mon, Oct 30, 2023 at 03:58:44PM +0000, Nadav Amit wrote: > > > > On Oct 30, 2023, at 2:51 PM, Byungchul Park wrote: > > > > I really spent a lot of time hesitating whether splitting it or not. > > However, the test result cannot be stable without those. I'm still > > confused. I think the test result should be stable at each commit, > > right? > > Of course. You can extract the optimization we mentioned, and perhaps > have more preparatory patches. > > Just a couple of comments that may also help breaking the patches: > > 1. The “stopping” logic is a bit not great. Try to see if you can > somehow use shrinker or OOM infrastructure instead. The stopping means "temporarily pausing" expanding migrc's pending queue, not shrinking folios.. Yeah my fault. I will rename it another not to make guys get it wrong. > 2. Regarding “overflows”, it’s not always a question of whether an > overflow would happen naturally, but whether a malicious process can > trigger it. I understand what you are worried about. However, it's intended that the variable is going to overflow. And the overflow doesn't matter if we are aware of it and careful in handling it. See time_after() in include/linux/jiffies.h. That would help you understand what I mean. Byungchul > > Regards, > Nadav >