Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1336789rdg; Fri, 13 Oct 2023 20:13:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqQ2fovf2ouSY5VeiPWpUOogw5hIixfyBNzJ97QHhrM8TEGra7xIXBty3uyWVZrV/uWUiN X-Received: by 2002:a81:6d49:0:b0:5a8:207b:48d with SMTP id i70-20020a816d49000000b005a8207b048dmr3459097ywc.11.1697253187214; Fri, 13 Oct 2023 20:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697253187; cv=none; d=google.com; s=arc-20160816; b=pFQXDucAIJf6cWFcFhc9Vh4OH6M+mLGSlPHzzIQbn2CUURU/JCgdMeWpri/DtmskU0 8hikpbPc41OcB1AotguyN89BqUGtD1i8U4E/fedyc80TthHpc9oPtcupDKUkxrKVEjFc t30feHooHqr8ReQF5OpEtt9xJ9QTxOPS7JRpJ7KFqh9AYJ99R/ns3tsi6v69qR8bqWHS EAFlqoTNKOVhtdRhVl6mCDwFR6gCkQNTxo4Ts5faZQc1oN5zkY7TY3sGMw0pCH5Q44Il ywwCJHczfp92s2l+XwbhSrFbmHnVCmdQmX9Zcpke4Zf0B+doG7/DVqNWIM+beDk2fPrX gDCQ== 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=mNdWlVr5rVnPi3a6YbGINMVONJA5HTfiTOC1vJzmNR4=; fh=L+Rxxpw41BMz7kC6XO+cXVQ2GI1ygPXVKzlx3MecFgw=; b=IAs2fZV/ReZEBSNmeB0KIib3sIrxe9vVvX2Tir/pRCx+SWfa1/BlPapBFNn1LSI4i3 +T55n1FYtZ997j+RcLNQlNkJk3J+ICNJsKB8XLr3GbrEWyuGfkU8waRlMgwuC738wsR6 XLBSpvYBu87SvTyfpBf1X9uaDxZLfSSGJggInFxcdoS/2IeeXE/4zt/m2EiIg24jF7re AzuNWyXBhrfEE4osoUbY3sxzHy+7l2kbjnWsLEdrlBZ6ZYN/HI39h8RoNIWGPl/jEL59 nuNMmSVfdEX77NtYnQy69r8X6dqcCli9RXALeXU1qXD75/7StoDHF48/sJRb8zAnvX5g iOXQ== 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:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z36-20020a630a64000000b005648b1d63aasi5692749pgk.553.2023.10.13.20.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 20:13:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 1A6DC807FCD1; Fri, 13 Oct 2023 20:12:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231469AbjJNDMD (ORCPT + 99 others); Fri, 13 Oct 2023 23:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbjJNDMB (ORCPT ); Fri, 13 Oct 2023 23:12:01 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A69B8B7 for ; Fri, 13 Oct 2023 20:11:58 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4S6pGM0xPpz1kv4d; Sat, 14 Oct 2023 11:07:55 +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; Sat, 14 Oct 2023 11:11:55 +0800 Message-ID: <9f56879d-2157-45ba-9f62-2c67b924da8d@huawei.com> Date: Sat, 14 Oct 2023 11:11:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH -next v2 09/19] mm: mprotect: use a folio in change_pte_range() Content-Language: en-US To: Matthew Wilcox CC: Andrew Morton , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot References: <20231013085603.1227349-1-wangkefeng.wang@huawei.com> <20231013085603.1227349-10-wangkefeng.wang@huawei.com> From: Kefeng Wang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 13 Oct 2023 20:12:20 -0700 (PDT) On 2023/10/13 23:13, Matthew Wilcox wrote: > On Fri, Oct 13, 2023 at 04:55:53PM +0800, Kefeng Wang wrote: >> Use a folio in change_pte_range() to save three compound_head() calls. > > Yes, but here we have a change of behaviour, which should be argued > is desirable. Before if a partial THP was mapped, or a fs large > folio, we would do this to individual pages. Now we're doing it to the > entire folio. Is that desirable? I don't have the background to argue > either way. The Huang's replay in v1[1] already mentioned this, we only use last_cpupid from head page, and large folio won't be handled from do_numa_page(), and if large folio numa balancing is supported, we could migrate the entire large folio mapped only one process, or maybe split the large folio mapped multi-processes, and when split it, we will copy the last_cpupid from head to the tail page. Anyway, I think this change or the wp_page_reuse() won't break current numa balancing. Thanks. [1]https://lore.kernel.org/linux-mm/874jixhfeu.fsf@yhuang6-desk2.ccr.corp.intel.com/ > >> @@ -157,7 +159,7 @@ static long change_pte_range(struct mmu_gather *tlb, >> continue; >> if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING && >> !toptier) >> - xchg_page_access_time(page, >> + folio_xchg_access_time(folio, >> jiffies_to_msecs(jiffies)); >> } >