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 7D22EC369D9 for ; Wed, 30 Apr 2025 15:44:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2DB46B00C8; Wed, 30 Apr 2025 11:44:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EDACF6B00C9; Wed, 30 Apr 2025 11:44:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA13D6B00CA; Wed, 30 Apr 2025 11:44:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BECC16B00C8 for ; Wed, 30 Apr 2025 11:44:09 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 564CCB7571 for ; Wed, 30 Apr 2025 15:44:11 +0000 (UTC) X-FDA: 83391131502.07.EB1E409 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by imf04.hostedemail.com (Postfix) with ESMTP id 6308140010 for ; Wed, 30 Apr 2025 15:44:09 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=k9utCm80; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1746027849; a=rsa-sha256; cv=none; b=W8lPGKUXOFcQrt8ektvSVm4DZh0xLtXIyzoG29AP9XPAOwRjhF9Bn7fVI9XLRLo+OUox/w x6NRUcHq6p9hYPAm1rDzm0sHkwOMdjxKv0/sKEY6CUBVOWPtv3B3xHbQEQcJ9/LnBnNA3V WlHU8s/crZXgIz6yZz99FnfU/RwzV1I= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=k9utCm80; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1746027849; h=from:from:sender:reply-to: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lN2dM9Y0opqHjvJrc0U2vh6JldOxtbw/QkwFsiUoA9s=; b=ST/OqwmdR94VcBMklXaRtArcALpMVlPn8QikgJD0sMD6if8DLkQoxfvEOv1X688SMuzAlO GIEYCnaJE7Ggz2GSiYPJELUuw/PazCXF8hKOY8L6x5rFI2FFCj8x5tBscFBhQZsGEiRhSj Xmt0D57O1fytj1CiKbM5FHg7GUh5kAM= Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-acb2faa9f55so945698666b.3 for ; Wed, 30 Apr 2025 08:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746027848; x=1746632648; darn=kvack.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=lN2dM9Y0opqHjvJrc0U2vh6JldOxtbw/QkwFsiUoA9s=; b=k9utCm80WbYxWsnmt7k9mTHfHn41nMARwXpdgC9rFGZKkldEcU7nPRGcxtlkPXKCs2 XR8RJMV0Z/DQnza66PdgJy7IxjPK6xfiid1SRnaX5kn05eKdi4poOPpFINpcrnqIhCyD WeWemW25RaX1Yl5gdNZjz3m87UDCQq/QWsxi5jaIwKI1DqU0CYfVB7DW23OTSN1rEmd5 /Ia6qHJoTTiyMBMMoeWQHgMDqc6HuC4+6cFyQTq4KhfirEJSjDCmSJMmLUu01lFTnDWD 7lBQXyzJzxwJTNTsywP8uRtTGBZ9cSqAwCL1XoTJkm53QFHocldjGjrTE7yHNuRZ1hC6 ywdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746027848; x=1746632648; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lN2dM9Y0opqHjvJrc0U2vh6JldOxtbw/QkwFsiUoA9s=; b=dZzNslUx8tKJFvIIgb8oJ2hgDCDuJpsr54v/815Lw4XBlmSiWpiFkUZ+jybxZoppQo V2wcbIhttr0Qo8Q76E27VB1vIOHmbsog4lQXq3v8exKk/TH5RDZmMBAFBXePMv3begnl rYNC9cuL+hlg+bCWY/dC83GrOVWzky1cyC9U7XHIdWW6Sblxsaed+RApLt5CfX8ib6Ev EjXJpQskimWVJ2GHXYBDH0XJXSLXw9NK9gVGVf/299dhRUEMz40EkLqkV0XNODVYDXYR zxcSqrBam15+N2yKer+2j2mPpZDY+DKp4aRRSUARj9acqq7jYI+Cg6vUi5HKrVnB2GoA sPpg== X-Forwarded-Encrypted: i=1; AJvYcCXe6MlpVkT6FsjUV5m9EYpmySvPPINAppOj8f0F+e/U1YQgbTiScMlp2WkGZHYSwOBqW/0t0WSfEQ==@kvack.org X-Gm-Message-State: AOJu0YxEAn8kq579PMSsLqnjVa7Cqx5DJVpd/HJHjFlL0IoKm1QjIEf/ tENW3m2PTjB1XYwfn4YexOyNbl+pPzWM1ASbxM8YxWLl4mG8j6rScnafwQ== X-Gm-Gg: ASbGncv1V8k0gWPYiqISgi/Wya5CytpuMGDnZV+Tf5M4NN5AvmOj2kEY8KKL5X1LcpA NJLP2n7XmBm3cv4wIgydSWvj4Q+mFfmN3gcW1LJ/Tdz0k3Jk+RYDPydZtuSaxX0z/na65wmlPUn UqTj8acXv3ko55y4YfwfB2DuPFye6KlwrQgldeBOXR93FtE/9nr8fmnE3FFdN48MWUDmO20YZJ+ jTK4Zz3K5uIVq1/UDxygm/ZZZtzmfAsz+UIXeEEq02Rs6s6m04hgUFMetIpKneEUWkcXRkijytV KRgy5AHK3qoUFWUjBPY0JvFhsFkfsJ++Q68SFlRuDpHmbKM931s= X-Google-Smtp-Source: AGHT+IFEHLl5KjKzSVH0Ad+juxGm5/UZ4LgeNh0mlrzd3A7HvBwHG1tFZW2/fxC11TzaaTb7mUSGaQ== X-Received: by 2002:a17:907:1b11:b0:acb:8492:fe with SMTP id a640c23a62f3a-acee25ff191mr303783866b.52.1746027847595; Wed, 30 Apr 2025 08:44:07 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ace6ed726f6sm931263266b.158.2025.04.30.08.44.07 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Apr 2025 08:44:07 -0700 (PDT) Date: Wed, 30 Apr 2025 15:44:06 +0000 From: Wei Yang To: David Hildenbrand Cc: Wei Yang , Lorenzo Stoakes , akpm@linux-foundation.org, riel@surriel.com, vbabka@suse.cz, harry.yoo@oracle.com, jannh@google.com, baohua@kernel.org, linux-mm@kvack.org Subject: Re: [RFC Patch 0/5] Make anon_vma operations testable Message-ID: <20250430154406.aadkqzguil2zafq5@master> Reply-To: Wei Yang References: <20250429090639.784-1-richard.weiyang@gmail.com> <8c268ece-71a7-470a-bf8b-71d3e4920977@redhat.com> <20250429235608.yvbcxybkfsmp6ow5@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Rspamd-Server: rspam10 X-Rspamd-Que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if+c drGwnF7EXdbZw6ORS+DQM+IXl6PEJ+oQkDuNp5ZyFuF3Lx8zqQ5cti9YBlIkyZYGpCrhpAZb/SqoEhH1YAZsUWahflDheZ5H7L/kshQCLkUVcQvb5E0tF1AsVJDBRcsBQd9d2sIWfjsDUho187A9fVv3s26znyG1LTxELog2Qfl29wDqKiq9Ep+nthRKhfMOlZo4/TEwwcWDBJ7PT/f4rT1B0ofhNY9ajx9J0qNNt/1aezRtXznGA5V6Lk9hvCYeRjqKZFp4kpZejUpcFOmg83TEJCA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 Wed, Apr 30, 2025 at 09:47:16AM +0200, David Hildenbrand wrote: >On 30.04.25 01:56, Wei Yang wrote: >> On Tue, Apr 29, 2025 at 10:41:27AM +0100, Lorenzo Stoakes wrote: >> > On Tue, Apr 29, 2025 at 11:38:23AM +0200, David Hildenbrand wrote: >> > > On 29.04.25 11:31, Lorenzo Stoakes wrote: >> > > > Wei, >> > > > >> > > > NACK the whole series. >> > > > >> > > > I'm really not sure how to get through to you. You were _explicitly_ >> > > > advised not to send this series. And yet you've sent it anyway. >> > > > >> > > > I mean, I appreciate your enthusiasm and the fact you've made tests here >> > > > etc. obviously. And you've clearly put a TON of work in. But I just don't >> > > > know why you would when explicitly told not to without at least discussing >> > > > it first? >> > > > >> > > > This just isn't a great way of interacting with the community. We're all >> > > > human, please try to have some empathy for others here, as I really do try >> > > > to have with you as best I can. >> > > > >> > > > This adds a ton of churn and LOCKS IN assumptions about how anon_vma works, >> > > > clashes with other series (most notably series I've been working on), takes >> > > > away from efforts I want to make to start to join file-backed and anon >> > > > reverse mapping logic, separates the two in such a way as to encourage this >> > > > to nonly grow and generally isn't conducive to where I want to go with >> > > > rmap. >> > > >> > > anon_vma, the unloved child. :) >> > > >> > > I would love to see a simplification that makes it less special, and I can >> > > understand how adding tests for the ways it is special can be >> > > counter-productive. >> > > >> > > > >> > > > This is part of why I explicitly told you please don't go down this road, >> > > > because you're likely to end up doing work that doesn't get used. It's not >> > > > a great use of your time either. >> > > > >> > > > Since there's something useful here in tests, I may at a later date come >> > > > back to those. >> > > >> > > Agreed, skimming over the tests there are some nice diagrams and cases. >> > > >> > > But I would hope that for most of these cases we could test on a higher >> > > level: test our expectations when running real programs that we want to >> > > check, especially when performing internal changes on how we handle anon >> > > memory + rmap. >> > > >> > > E.g., do fork(), then test if we can successfully perform rmap >> > > lookups/updates (e.g., migrate folio to a different numa node etc). >> > > >> > >> > That's a great point! Wei - if you could look at making some self-tests >> > (i.e. that live in tools/testing/selftests/mm) that try to recreate _real_ >> > scenarios that use the rmap like this and assert correct behaviour there, >> > that could be a positive way of moving forward with this. >> > >> >> I am trying to understand what scenarios you want. > >That is exactly the task to figure out: how can we actually test our rmap >implementation from a higher level. The example regarding fork and migration >is possibly a low-hanging fruit. > >We might already have the functionality to achieve it, *maybe* we'd even want >some extensions to make it all even easier to test. > >For example, MADV_PAGEOUT is refused on folios that are mapped into multiple >processes. Maybe we'd want the option to *still* page it out, just like >MPOL_MF_MOVE_ALL allows with CAP_SYS_NICE to *still* migrate a folio that is >mapped into multiple processes. > >Some rmap tests could make sense for both, anon and pagecache folios. > >> >> Something like below? >> >> * fork and migrate a range in child >> * fork/unmap in parent and migrate a range in child >> >> If the operation is successful, then we are good, right? > >Yes. And one can come up with a bunch of similar rmap test cases, like doing >a partial mremap() of a THP, then testing if the rmap walk still works as >expected, pairing the whole thing with for etc. > >One "problem" here is that even with MPOL_MF_MOVE_ALL, >move_pages() will not move a folio if it already resides on the target node. >So one always needs two NUMA nodes, which is a bit suboptimal for testing >purposes. > >For testing purposes, it could have been helpful a couple of times already to >just have a way of migrating a folio even if it already resides on the >expected node. > Thanks for all those detail explanation. I need some time to digest it. Since lack of some background knowledge, I may have further questions on this. Hope won't bother you too much. >-- >Cheers, > >David / dhildenb -- Wei Yang Help you, Help me