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 9D84CC52D6F for ; Mon, 19 Aug 2024 14:22:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 09A546B007B; Mon, 19 Aug 2024 10:22:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 04AB66B0082; Mon, 19 Aug 2024 10:22:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2D3F6B008C; Mon, 19 Aug 2024 10:22:49 -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 C40C16B007B for ; Mon, 19 Aug 2024 10:22:49 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 525E8161332 for ; Mon, 19 Aug 2024 14:22:49 +0000 (UTC) X-FDA: 82469211258.30.5E4BA1E Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) by imf17.hostedemail.com (Postfix) with ESMTP id DB97B4001C for ; Mon, 19 Aug 2024 14:22:46 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="bU/57qqV"; spf=pass (imf17.hostedemail.com: domain of usamaarif642@gmail.com designates 209.85.219.42 as permitted sender) smtp.mailfrom=usamaarif642@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724077289; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Nhkr7iqFh3RzbexiAe8kbSaRnIYZ6ohJ8NbUkCceiNk=; b=KUkLZjfBT2UCnpRXjbwRK0IKl4zA87Gmhr73TnH+anifYvEieksDGhsLC5PaX+c69T9UQo 2ez8P8ekPKp4rfirzuRaX85DwiRjyRFAZ/3FvMXgIdHbZ4bQvzRnTqFqSPtwPQ5S/2mIQN 19o8prto3VOpCZQByyiJ0vsVUHb8yY0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724077289; a=rsa-sha256; cv=none; b=OJevMtd9OojjfxcAoDVTB6MK2i5HP6iGfjLRoigWeJ30nPDm3Xk+KJc3JDmluXvA3wN39C p4ptcO/OJ1XgLn0wjSx2IeaXhzRYskvgjqCJ6s3kGNI6w8Jv/hLZhoRlCL2gsO+TMq2X+j 5i+tK2KSAVZOmbvkIkCtCnXLPKxlaDI= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="bU/57qqV"; spf=pass (imf17.hostedemail.com: domain of usamaarif642@gmail.com designates 209.85.219.42 as permitted sender) smtp.mailfrom=usamaarif642@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6bf9081b650so9570006d6.3 for ; Mon, 19 Aug 2024 07:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724077366; x=1724682166; darn=kvack.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Nhkr7iqFh3RzbexiAe8kbSaRnIYZ6ohJ8NbUkCceiNk=; b=bU/57qqVu5alcurNHyAMwN1qlYSZQZUHDv42mrVYLE2BFo7HMNUtgmjVvNrhcWTHsz FHg9j9CtTS/k+k/mynYlTb+B+KxtoxmT2A0SV5QOFeRorfxX3IH8nPxJPDmjP0ysPWPb Iz0d9SLwsNghBSVd/EQh6YFsJ4vAAki+cKNiybWWXfgREtL6Bp+Jpb3Jdbkj4CvZ26dn Hw/TpRA7D45UFC85mZtRsfjHtgxmUx2DdECAQFGKDYW6SonT/wpWAbbQwFCcNOu1E/6w 6/1s9pdhMK4BZq6hfP9XBsPYy4Dcjpx0biHe5GzC1qVSPTBjienndwgXH1ezaFgRrTAj WghA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724077366; x=1724682166; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Nhkr7iqFh3RzbexiAe8kbSaRnIYZ6ohJ8NbUkCceiNk=; b=M33iFtO6saVYGsLjZ4VlEakZp24Uauq3yLz8v4c1mALWHT6KwYikZq8B20II+/SpaL WKk0YcF+98xRXw8kIT3hkmjrCWk2p+5ThvIkqcjrKt5VF/7peKVHF54Xszqzob0zwb0F As3TS6wSao0/jULzc7qubxxgaHZB825maj5SOoFOBaSsqOTDNtsveF0prFlvBJpwevTD Sb2slRb28vT7poncF/pReixtPKOJy6/GbUZ/mtiEtyRcBBbypxSUNt57VWmquZoO6Rrx DAGZjQgb20ykAZ0ddSm8kPfz9AfE0heiOC9dncAWMM31Z3QPzk9+rgzPvJO2NOpQIMT9 rLzA== X-Gm-Message-State: AOJu0YzQ/XJJGBbvlpxeKnGS2fq5ZyFBYUdEYxmb9tUxcYeJiREtAlYz ptEZ+D4tLKMKQ8+pG+a9b8zngz6IlyBzq2wYmKra0T1Fd1T5OqEB X-Google-Smtp-Source: AGHT+IHkF23CUAgzsBPLP4cpgRYRq2jqu90osR1mDQck6JGw0rpnWCeZrHevD+ptagafaKP5T3G9Mg== X-Received: by 2002:a05:6214:5c41:b0:6b4:fea8:6bfc with SMTP id 6a1803df08f44-6bf8949f60fmr88519896d6.10.1724077365747; Mon, 19 Aug 2024 07:22:45 -0700 (PDT) Received: from ?IPV6:2a03:83e0:1145:4:1409:786c:cb1d:c3fb? ([2620:10d:c091:500::7:e1ca]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bf6fef0267sm42825436d6.113.2024.08.19.07.22.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Aug 2024 07:22:45 -0700 (PDT) Message-ID: Date: Mon, 19 Aug 2024 10:22:44 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/2] mm: collect the number of anon mTHP To: Barry Song <21cnbao@gmail.com>, David Hildenbrand , akpm@linux-foundation.org Cc: linux-mm@kvack.org, baolin.wang@linux.alibaba.com, chrisl@kernel.org, hanchuanhua@oppo.com, ioworker0@gmail.com, kaleshsingh@google.com, kasong@tencent.com, linux-kernel@vger.kernel.org, ryan.roberts@arm.com, v-songbaohua@oppo.com, ziy@nvidia.com, yuanshuai@oppo.com References: <20240811224940.39876-1-21cnbao@gmail.com> Content-Language: en-US From: Usama Arif In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DB97B4001C X-Stat-Signature: rbree3689fjws91s7a1y7ynznjggy7nt X-HE-Tag: 1724077366-392604 X-HE-Meta: U2FsdGVkX1997QLtHNOmIhnRw3XAW9QY2M/kIWvGcXv8vijrjkQ07fACyNYVu3ZXGXDY4wgnRbTtoJbe0cApXaW3J7Q8Ri+iEYFQ4HfKwak2nCPXfx7GRqHFFOTNs1sK4s22PZMIImmBHrvfOxgtYXaQq/wfqlAtHifSN+uwVgsGyiu/5E9dXAi7b8IDCXXB+JrK2DZiFyBfuuUTKum9fIJXKiHbw/eicLTFcVJ74qxnBze1IWw8XezRbGJ1z6aEtwlI4axnEHZo0xSOWVkxGgcRponTGXyhZGwClAj4VDHJLDYyKGmC+Ot3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P+YDKne+QEUfrTkuo8U3TDdUSHYb6G+t3BxTEYjcBVmw8aOmGVr1fXitof3TPhSmRsZs7ApUq3oA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.292789, 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 19/08/2024 09:52, Barry Song wrote: > On Mon, Aug 19, 2024 at 8:33 PM Barry Song <21cnbao@gmail.com> wrote: >> >> On Mon, Aug 19, 2024 at 8:28 PM David Hildenbrand wrote: >>> >>> On 18.08.24 09:58, Barry Song wrote: >>>> Hi Andrew, David, Usama, >>>> >>>> I'm attempting to rebase this series on top of Usama's >>>> [PATCH v3 0/6] mm: split underutilized THPs[1] >>>> >>>> However, I feel it is impossible and we might be tackling things >>>> in the wrong order. >>> >>> Is just the ordering suboptimal (which can/will get resolved one way or >>> the other), or is there something fundamental that will make this series >>> here "impossible"? >> >> i think it is just the ordering suboptimal. Ideally, mTHP counters can go >> first, then the new partially_mapped feature will rebase on top of >> mTHP counters. > > Sorry, please allow me to ramble a bit more. > > The nr_split_deferred counter is straightforward and simple without the > partially_mapped feature. Each time we enter split_list, we increment by > 1, and when we leave, we decrement by 1. > > With the new partially_mapped feature, we can enter split_list without > actually being partially_mapped. If the MTHP counter series is processed > first, the partially_mapped series can handle all cases while properly > clearing and setting the partially_mapped flag. These flag operations > need to be handled carefully. > Currently, I notice that Usama's series is clearing the flag unconditionally > in all cases. > > In simple terms, mTHP counters are just a counting mechanism that > doesn't introduce new features. However, partially_mapped is a new > feature. A better approach might be to handle the counters first, then > ensure that the new feature doesn't break the counter. > I am ok if the series needs to be reversed, I think the difficulty is for Andrew to tackle my series, yours and Yu Zhaos, which all seem to be touching the same code, so whatever makes it easier for Andrew I am happy with it. >> >>> >>> -- >>> Cheers, >>> >>> David / dhildenb > > Thanks > Barry