Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp647588rdg; Wed, 11 Oct 2023 01:06:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqmfd9Dt9NpCzgo2ULZcsdwksTz/3enc2YmNGPzs6TEw+YsK+vxL3d3keJgWseYeTCllsQ X-Received: by 2002:a05:6a00:14d3:b0:68c:5cec:30d4 with SMTP id w19-20020a056a0014d300b0068c5cec30d4mr22989263pfu.27.1697011569598; Wed, 11 Oct 2023 01:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697011569; cv=none; d=google.com; s=arc-20160816; b=DlUrk5Pw7I+7GfN3nVu1K5w9sYg5Gd5dabMv+YA4KJtd/xwcojqL2cVH7nLwp7s+XY vxlKsVXmqst/0Omx5s71M6aHAm2gbDWnAkTl3rbcNni1TrGYhTLxPa0sj+GKuLaQGx3X yg1gInTD/3/yyJr0l0MA76mJgixcsWkA11juZeJ6e3v8/JUf1hQHak5IlPY9+765aZ6d APhsrnmgU9WBPulhLxgtOrsYQNYvP5Oa9x3uh5cpZKGljwIVZNHwEtXnqvERP+880Mj3 NgT4f+GO3Yu8NWtvREzD7iIK5EB29ryLDojSVkHSFTMfhQKv2U6DFYwnbUw50NQqyCE3 Fyug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=19b7QAbvAdVE7kK3xawsZEGJax5in/lnMeETnzXI5HQ=; fh=GQmZMvissg8N4ZZ2WFOjCWnF8ygvcvhwDn9oGdSdC/Y=; b=Cbc2VMT7z8umh6Jq1C20fAvbdginokg31HYfkGpyZgTQUjZenTuFnqD2cqDQsgQVIL Tky3kMzaEKqKaoTp2vGnbNcZZnuIIyeKedUv/kEW7I/5FVbGoIUQM0HOAxbKD/ujp1Ty J1LL1Q44j/VO3fNNzZuOKp5VS7R/CyDjdxiANYt3qfSdsg8t5sITy5f+BmT5OwaJWVNE iVDIGfc3A5K88awPfOysaqkRZQqYFj95izC91h45v960lQOVS6pPxkS8NXRBN0nkPnTd k9Ggowm3HR0R3Qh+FxHuTniAfuptLgfqw8+rtGT+vndCkqc0jNOdpOfK3EmttgGAx6P+ 7htA== 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:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id o20-20020a639214000000b00573fbbf187dsi13855797pgd.216.2023.10.11.01.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 01:06:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 21AA98132A4D; Wed, 11 Oct 2023 01:06:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbjJKIFt (ORCPT + 99 others); Wed, 11 Oct 2023 04:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbjJKIFs (ORCPT ); Wed, 11 Oct 2023 04:05:48 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B3E092 for ; Wed, 11 Oct 2023 01:05:46 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4S54wp0xLGzkYC2; Wed, 11 Oct 2023 16:01:46 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 11 Oct 2023 16:05:43 +0800 Message-ID: Date: Wed, 11 Oct 2023 16:05:42 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH -next 1/7] mm_types: add _last_cpupid into folio Content-Language: en-US To: "Huang, Ying" , Matthew Wilcox CC: Andrew Morton , , , , Zi Yan , Mel Gorman References: <20231010064544.4162286-1-wangkefeng.wang@huawei.com> <20231010064544.4162286-2-wangkefeng.wang@huawei.com> <3b56b26b-a550-4e06-b355-55564b40cfb5@huawei.com> <874jixhfeu.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Kefeng Wang In-Reply-To: <874jixhfeu.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Wed, 11 Oct 2023 01:06:07 -0700 (PDT) X-Spam-Level: ** On 2023/10/11 13:55, Huang, Ying wrote: > Kefeng Wang writes: > >> On 2023/10/10 20:33, Matthew Wilcox wrote: >>> On Tue, Oct 10, 2023 at 02:45:38PM +0800, Kefeng Wang wrote: >>>> At present, only arc/sparc/m68k define WANT_PAGE_VIRTUAL, both of >>>> them don't support numa balancing, and the page struct is aligned >>>> to _struct_page_alignment, it is safe to move _last_cpupid before >>>> 'virtual' in page, meanwhile, add it into folio, which make us to >>>> use folio->_last_cpupid directly. >>> What do you mean by "safe"? I think you mean "Does not increase the >>> size of struct page", but if that is what you mean, why not just say so? >>> If there's something else you mean, please explain. >> >> Don't increase size of struct page and don't impact the real order of >> struct page as the above three archs without numa balancing support. >> >>> In any event, I'd like to see some reasoning that _last_cpupid is >>> actually >>> information which is logically maintained on a per-allocation basis, >>> not a per-page basis (I think this is true, but I honestly don't know) >> >> The _last_cpupid is updated in should_numa_migrate_memory() from numa >> fault(do_numa_page, and do_huge_pmd_numa_page), it is per-page(normal >> page and PMD-mapped page). Maybe I misunderstand your mean, please >> correct me. > > Because PTE mapped THP will not be migrated according to comments and > folio_test_large() test in do_numa_page(). Only _last_cpuid of the head > page will be used (that is, on per-allocation basis). Although in > change_pte_range() in mprotect.c, _last_cpuid of tail pages may be > changed, they are not used actually. All in all, _last_cpuid is on > per-allocation basis for now. Thanks for clarification, yes, it's what I mean, too > > In the future, it's hard to say. PTE-mapped THPs or large folios give > us an opportunity to check whether the different parts of a folio are > accessed by multiple sockets, so that we should split the folio. But > this is just some possibility in the future. It depends on memory access behavior of application,if multiple sockets access a large folio/PTE-mappped THP frequently, split maybe better, or it is enough to just migrate the entire folio. > > -- > Best Regards, > Huang, Ying >