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 7CD4CC3DA4A for ; Mon, 19 Aug 2024 08:52:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E41936B0085; Mon, 19 Aug 2024 04:52:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DF04F6B0089; Mon, 19 Aug 2024 04:52:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C90CD6B008A; Mon, 19 Aug 2024 04:52: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 AA48A6B0085 for ; Mon, 19 Aug 2024 04:52:49 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 42A921210CA for ; Mon, 19 Aug 2024 08:52:49 +0000 (UTC) X-FDA: 82468379658.22.3D66DB4 Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.178]) by imf29.hostedemail.com (Postfix) with ESMTP id 6C32C12000C for ; Mon, 19 Aug 2024 08:52:47 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=g5suTa9e; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf29.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.221.178 as permitted sender) smtp.mailfrom=21cnbao@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724057552; a=rsa-sha256; cv=none; b=RzUEGa9pSFin4WXXdfPc5roinjwy9+jdVx7A/QbvBRyMDMxGHrdkOUS+R1fhJP0VPs5+I1 teUOzQexCJCF23yuj0Cer/EaTbada9mIpRYs3P8g79Wly0ZH8DCGMmmqkM6ywzObDC7k6P GuUoeAvBjSeUKkYMlbRZZ1y368f9a5o= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=g5suTa9e; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf29.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.221.178 as permitted sender) smtp.mailfrom=21cnbao@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724057552; 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=T5chdCGstKz2GQrS2kG/64adcjjI1jnaYsuqfnGBHws=; b=nZoKYBfmam0VbUA67vpLXRP/1KJCoDwN7CNDi/Jm9OwLOgltJbiLvBamiumsD8mPCudz1o N937qWiDi2Y3soK4/HtFjdLuJmVfnG22wptexHSjBoeGAEz6HJ8HwEhqXKT+4cfyK26KfZ /vZiM+xiYnCM0gWmU3DFTHK7rTk4exI= Received: by mail-vk1-f178.google.com with SMTP id 71dfb90a1353d-4f50d8ce6e0so1496298e0c.0 for ; Mon, 19 Aug 2024 01:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724057566; x=1724662366; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=T5chdCGstKz2GQrS2kG/64adcjjI1jnaYsuqfnGBHws=; b=g5suTa9ec+bAn0kdvfvXOhSX4xGWZwzjk2Krccme49bBWECVp8N351EWyf4aWauJAO sc7HM1f39edXuc4jknoXJhyVVaLsJil7RYcpDjw0fzeQp99GIWOr2m9X0eqmCvvKnV+b sGClADw42AxRyPcOyAVfcl5y9tH58jhhKuVRYqduXxxUunTfZM+ODmFi9T1PhO9d1Obt dTOzfDLYzHOg3wcALnX+VkcapPezQg+kJu6fmTkpQFR0WluR4HhkZlOH5dD9mS7Kwejl UWz1NT2TT6VZ3FpEfGFoAZR1xvFFQs0CH1dlb62Tuwd5WypqiBL3fxkFTRI2qqCX/rla 6v2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724057566; x=1724662366; h=content-transfer-encoding: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=T5chdCGstKz2GQrS2kG/64adcjjI1jnaYsuqfnGBHws=; b=Rn6eI2sh8+NQFmYfcwL56yuKkPqgphUxWuvJ25Fds/z/YYkPwraemqDzX/gLM3X5mn T5+37nBH9/ZKVhDxmRBR1pcvF9NLJLdBvF9sLFwPqGu1iovUC+xb/xBjKLmkDByOno/2 tR/D4z6fC6Cm90zGDu8ACQa1i9jkXcCnzi0f+eorBAOko2DzzYlnejwjdoWPNbV2/sCE tGrObDmPCQFksoF2SO7WxfFitssxfQ+RvuBV0NKUBaYLCv59jmk7Vq4NdDk8KoN4vAMJ lhwTcxq/3rP1cTFfUJjDwOHwI607gUhKWw0zZ+0oODq0B1QeJY8ZsD5izLVj98BfgdUu xWgA== X-Forwarded-Encrypted: i=1; AJvYcCW3xz/eWA/OU1i+tY0LsPYFIURR1P03NKh0kyrg/PN0JiS1PkZVFTPex7GKhvdxK53+5v/sMK0BrPhmMPGb/XGLNu0= X-Gm-Message-State: AOJu0Yyw5ckreeBrtl/OjtSuM2+HSS9CwxEncrtMl86dKniX6Nm/YfD5 k9IvAzG6xCq3/BvHea5C9aSaofGosQ1KZh+UDbx6Mud2L8uYfsfyJV7HY4ryrQFiaxMf3bJcUxL yCSvAcpDcgnNKBRqJnfKqVdPsYeM= X-Google-Smtp-Source: AGHT+IEpHyWNl04LZuaLolZ85bfdEpT6t4WsvZXZV5km2djGlvxgDnpQ3AwcVCe+cguEt27JTvZVvjECqMan+18xDK8= X-Received: by 2002:a05:6122:291a:b0:4f5:2aa9:a447 with SMTP id 71dfb90a1353d-4fc6c9f26c5mr10666129e0c.11.1724057566337; Mon, 19 Aug 2024 01:52:46 -0700 (PDT) MIME-Version: 1.0 References: <20240811224940.39876-1-21cnbao@gmail.com> In-Reply-To: From: Barry Song <21cnbao@gmail.com> Date: Mon, 19 Aug 2024 20:52:35 +1200 Message-ID: Subject: Re: [PATCH v2 0/2] mm: collect the number of anon mTHP To: David Hildenbrand Cc: akpm@linux-foundation.org, linux-mm@kvack.org, Usama Arif , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Queue-Id: 6C32C12000C X-Rspamd-Server: rspam01 X-Stat-Signature: xucds5qc8z6e5q5yay6gcmemmb68pgqr X-HE-Tag: 1724057567-805008 X-HE-Meta: U2FsdGVkX18745rpU78HkYpVhks0uhZSHroSxHBHgco7yAm+DxtLKyzcJ6202CJXYLQb60vnDNy8aLCkfYnm2qcDNm/GaScuU0HYfJEI7F3Q1FeN4QxJ9KKa4HPePFjCbfrVVm40sw4bkxj4tRL4EpwNCpXbseMFkrCQ4w1DMdfQwMntbNUmtmDUxQEmtXKV5jfiiyFqlzFfrsx7t6KAVWjCqxwvCevX4bL8M0WGC++zSCoTtjjShe/9QYEIhyVihufAUZgF7aamdN0aGiDWXIUpZl5zT3kw5T0T+UEXqiMJ9mDlkW/8N93ihwBk4SBVD/t04//Na7rMHF5Qo9SFXKdiVykcAs/MTvbAoleShcktXvHWaYHRC1vs8Mc35peQr5TE5iXdGtB36EWocZSXV+lRGmBjdXT+Kt3gmPLxckXrxcV1vHWd+bm3hQcz0jLhpUXQAex78MGKXEmsqgZ8raZw4ObMcIXQ8Icqhuv0uWnQVHCTeCphAeQ8sYfpY3F6N8pKoIBCDw0o05KJ4WSduXgC+ozPPklJ0NwfOUuQt6PMhxIYE21ad+roOQtp8JHkORA0Lhxzqz9qDZs7PoF1MKl2HoezLhL5uJUVwRlZAt9Wz23VuOyl5tixI0m4wCytxmm+IdgfTgRRn5DMoVbgLO8ITOMZXKVYYwkSiXBPqtWqS53IfmgVYVJ/hCin0Xptc8aecJqiGO1eTGJrivaqS6TzWIbmaJe/lJAKyXPHh7Rsoxf+RhEbBvwV9I9CiAFM35i0wY4/w1oihKIcAKnthSRPuQwvz8KppMJYmk4GJ+Yg2T/Lm4rM7V9DZdYLUkms0AJrIQSqOvSDxL6Vdaq0156eqD+OEywfvvkFA66yFCQMLpYRxBXtxe1OeUaJFCdXgMYLPxB6LWSMNJKOcCS5fyc5PXFWzRzm/c/DHmMIQH8Mm/Zt5s7fTy4iHpw6WuFiIXHSIVZu7JOJJ3gSz9a el7Ynxuk /NcJsqHY6aOxkR8FJhaF0o4R2kvZ6QXv+csnCgEgHtAkvzheYT0nzCPlGZo5INGwfOhB7XM1QhCdEHmxRyD2sw703AZLtVY7hNOXo30ikwa51ihwy11mHh26ydV/pMpSx/1xU8+N5YdPufmUxqrPiyJSXFnSO/M5GcqeMUJaSchpriSw9pzsInaNKgLyD23WJGMhxMqIhG/YUM9pekakTf2WcUOdMBr446YPiFQOAO32rggxgWHbCAdN9woWe+Qrj98R/XXnODiGf4e6JM+kczWrbBJFvbhpPNFXnuVrJABMC1+JQ8FW4HT9vmS9c42V2x7M97N4wSVwnc1UtqjdjPpGqxg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.092346, 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 Mon, Aug 19, 2024 at 8:33=E2=80=AFPM Barry Song <21cnbao@gmail.com> wrot= e: > > On Mon, Aug 19, 2024 at 8:28=E2=80=AFPM 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 serie= s > > 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 unconditionall= y 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. > > > > > -- > > Cheers, > > > > David / dhildenb Thanks Barry