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 3279FC433EF for ; Thu, 17 Mar 2022 08:13:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6FE076B0071; Thu, 17 Mar 2022 04:13:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6ADE88D0002; Thu, 17 Mar 2022 04:13:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 575B48D0001; Thu, 17 Mar 2022 04:13:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 48B586B0071 for ; Thu, 17 Mar 2022 04:13:56 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F17F418259E31 for ; Thu, 17 Mar 2022 08:13:55 +0000 (UTC) X-FDA: 79253164830.22.AE75F68 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 54F1D140023 for ; Thu, 17 Mar 2022 08:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647504834; h=from:from: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; bh=xxA0Pce6UnOZWW6gsq8il76yFsehAiTQ6twP7i/3/GQ=; b=i9ocHWQ4ruFxw25UNHFShxytWepuLkCReLw3lss3KN+Ovdfa+ThGwCIDnbPe+jitf0YTPx WF9pB+KJo/PISDHdtLt+ZatBzQgNYNCrmOreUoawU/NJtuLinQHJBwIi1fZ9OVCMcE+0Jf 5bJ3tJrBaRJf/FEfQG8DJeuaU6A6X/Y= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-114-hiWEjQeJPvS-C7o12uCkmg-1; Thu, 17 Mar 2022 04:13:53 -0400 X-MC-Unique: hiWEjQeJPvS-C7o12uCkmg-1 Received: by mail-wm1-f72.google.com with SMTP id q65-20020a1c4344000000b0038c7c65e120so132579wma.7 for ; Thu, 17 Mar 2022 01:13:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=xxA0Pce6UnOZWW6gsq8il76yFsehAiTQ6twP7i/3/GQ=; b=etQmiCcF5+Rj/STw+DmssAQdxChs9/Ol7CaQ7H9PYGOZI42AczrisnlS7UuHHjv2cI pFz8SLQogUjEoydGZPp+vhcsigoHn14Zl7NNTETVQ2gfi2RzblBfjSPQH/T1vTBH6s7t 39/NjH0ziKWy8ZFm+9JgrUpe3n4+7TX15Bmi/bUbqhmOrlTWTpsfhiAc1bW292dm0lim vRtmdeSMHvtiEatBWWMC2A4Ppubc08fWHnYloQ8TQpnBubFQPjHOUXvb/eqBlChTMG75 rfZufRMajgcLvHJ+R8Yz76a43gjwpBZ24QHeg9AXlaGqdDNzoKIKGYkTmhy8sOPz3PsB M5iA== X-Gm-Message-State: AOAM533uDbsBbLtTf48cfzcL+kkPBe0OIBHHn4d9mlbw7YcvbO2pz1Ma xFJs7dkU383wYsTc83QhUCKPOKA6T2lvOC8XNFjevRifFETuMaSbduMwD2vzzlLFksfRa4ChpJz 6uJvRw9XyagE= X-Received: by 2002:a05:6000:144a:b0:203:8688:35d with SMTP id v10-20020a056000144a00b002038688035dmr2896890wrx.399.1647504832460; Thu, 17 Mar 2022 01:13:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkIygRnwahr8xhyLvIiK8lTpLSYuqqmv1avWZ31V4hbmg8hvmgWPIvr5DZvtTFDGtJ3e2QVw== X-Received: by 2002:a05:6000:144a:b0:203:8688:35d with SMTP id v10-20020a056000144a00b002038688035dmr2896866wrx.399.1647504832168; Thu, 17 Mar 2022 01:13:52 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:d000:22e9:afb1:c890:7468? (p200300cbc707d00022e9afb1c8907468.dip0.t-ipconnect.de. [2003:cb:c707:d000:22e9:afb1:c890:7468]) by smtp.gmail.com with ESMTPSA id j7-20020a05600c410700b0038c72ef3f15sm2542317wmi.38.2022.03.17.01.13.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Mar 2022 01:13:51 -0700 (PDT) Message-ID: Date: Thu, 17 Mar 2022 09:13:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v1 1/3] mm: split vm_normal_pages for LRU and non-LRU handling To: Alistair Popple , Felix Kuehling Cc: Alex Sierra , jgg@nvidia.com, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jglisse@redhat.com, willy@infradead.org, akpm@linux-foundation.org References: <20220310172633.9151-1-alex.sierra@amd.com> <20220310172633.9151-2-alex.sierra@amd.com> <07401a0a-6878-6af2-f663-9f0c3c1d88e5@redhat.com> <1747447c-202d-9195-9d44-57f299be48c4@amd.com> <87lex98dtg.fsf@nvdebian.thelocal> From: David Hildenbrand Organization: Red Hat In-Reply-To: <87lex98dtg.fsf@nvdebian.thelocal> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 54F1D140023 X-Stat-Signature: cj3dzn4gb9epxckt8yqg674bg9m4epgn Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=i9ocHWQ4; spf=none (imf23.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1647504835-224718 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: On 17.03.22 03:54, Alistair Popple wrote: > Felix Kuehling writes: > >> On 2022-03-11 04:16, David Hildenbrand wrote: >>> On 10.03.22 18:26, Alex Sierra wrote: >>>> DEVICE_COHERENT pages introduce a subtle distinction in the way >>>> "normal" pages can be used by various callers throughout the kernel. >>>> They behave like normal pages for purposes of mapping in CPU page >>>> tables, and for COW. But they do not support LRU lists, NUMA >>>> migration or THP. Therefore we split vm_normal_page into two >>>> functions vm_normal_any_page and vm_normal_lru_page. The latter will >>>> only return pages that can be put on an LRU list and that support >>>> NUMA migration, KSM and THP. >>>> >>>> We also introduced a FOLL_LRU flag that adds the same behaviour to >>>> follow_page and related APIs, to allow callers to specify that they >>>> expect to put pages on an LRU list. >>>> >>> I still don't see the need for s/vm_normal_page/vm_normal_any_page/. And >>> as this patch is dominated by that change, I'd suggest (again) to just >>> drop it as I don't see any value of that renaming. No specifier implies any. >> >> OK. If nobody objects, we can adopts that naming convention. > > I'd prefer we avoid the churn too, but I don't think we should make > vm_normal_page() the equivalent of vm_normal_any_page(). It would mean > vm_normal_page() would return non-LRU device coherent pages, but to me at least > device coherent pages seem special and not what I'd expect from a function with > "normal" in the name. > > So I think it would be better to s/vm_normal_lru_page/vm_normal_page/ and keep > vm_normal_any_page() (or perhaps call it vm_any_page?). This is basically what > the previous incarnation of this feature did: > > struct page *_vm_normal_page(struct vm_area_struct *vma, unsigned long addr, > pte_t pte, bool with_public_device); > #define vm_normal_page(vma, addr, pte) _vm_normal_page(vma, addr, pte, false) > > Except we should add: > > #define vm_normal_any_page(vma, addr, pte) _vm_normal_page(vma, addr, pte, true) > "normal" simply tells us that this is not a special mapping -- IOW, we want the VM to take a look at the memmap and not treat it like a PFN map. What we're changing is that we're now also returning non-lru pages. Fair enough, that's why we introduce vm_normal_lru_page() as a replacement where we really can only deal with lru pages. vm_normal_page vs vm_normal_lru_page is good enough. "lru" further limits what we get via vm_normal_page, that's even how it's implemented. vm_normal_page vs vm_normal_any_page is confusing IMHO. -- Thanks, David / dhildenb