Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp360973rbe; Thu, 29 Feb 2024 01:29:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVsRXYZu80tq+AJMjUmOPTA4ZBdMYUeIyf5FXKGW9/uAXUNPOUVkrwOqeoHVOkylDC4+oTODeDOAKWdYRAQPdfaYlBjRIOQaTM12vmpbA== X-Google-Smtp-Source: AGHT+IGC4KP5K8HSSIBX/8JdX/RSY2NoF0S7aA7BcgTnvM6NYb3jHW97x+EnKLmKN2OOLAMtJL9X X-Received: by 2002:a25:830b:0:b0:dc2:466a:23bd with SMTP id s11-20020a25830b000000b00dc2466a23bdmr1640637ybk.54.1709198999364; Thu, 29 Feb 2024 01:29:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709198999; cv=pass; d=google.com; s=arc-20160816; b=emQQlithYraAfFZMVUXwQm/5mnCDtmCrpSi0OsVMibtL7Ac6R2FZX/EvufQOFCU8ib OPebJK5X0IlkPCyvcfFkcYxoVMzKFO+6Cr3951xQJgTaNLCrLYL+Vprc7T2zGZpCaF9P ZbeaxuQHZZFUZl6GPsc+kCMrEcZulDL/YGo0EfiB2guuMNmxD5Fhj9MDtSSN/Q9b5PhQ GPanVQHqqOBVd6wLzRlKp7JgcvXXrVPHBXtU8mJfxct0uHQEg/0ctjbrCdbYtBhAuznO Vu20kRHsFnWVhnQLHBOu56qT5fSMz1OHtmAjXuoYzlOspkleeRSLULZlTZLeAmXJaIzN Z5cA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=roGD9plOBmITqPpAYopjOz+IeuhxR2afv9D323s9/5k=; fh=44oceOzph1bt5L9KewN10X09A/UWZ//6QmIvHwEF9JM=; b=rjcAkoRUSRtYZb1gqhzoh4TgCfergtktPjP5nFowZ7q0hUAY+VGOoCARDSP47T61De PjYleq8O6iGsPCsntUK9MklrdynL41Lwt8lRTAA2Q7SH6W4KRssjJkmurhgX3LAENdCR cv3GacCVFLhlR976emFbTFxCvzDHR3ceJ74uYhkR7LhHxwACQSs0+jed23e4mxZabsdj kliUhgo0GxXxgn+nNvi9ssuFUdQ2CaVp5M4OnarHKZvlEjRmThDUouGgDZ64vkmJ+0Q9 3RUbwwpV9hweBTomfS1PLgjtqj6b7nA7ZJkxIHSzX392Gu3QQkkguk44K578YTtAA5mK +Gyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-86424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86424-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x23-20020ac84a17000000b0042ebd07333dsi503314qtq.254.2024.02.29.01.29.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 01:29:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-86424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86424-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 227DB1C23913 for ; Thu, 29 Feb 2024 09:29:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 894FE5CDF2; Thu, 29 Feb 2024 09:29:53 +0000 (UTC) Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C46C5B698 for ; Thu, 29 Feb 2024 09:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709198993; cv=none; b=cPFKw393IpCOAH3WyIFnZCWFkUn2YvBLn2B3WGBdaCTOwLCPhOMxbBRW5twHC/0+V+6jHWq0/Zd3LrqV5ZA8VciPWKB4Wz/4aHfW+SVXeA5M44a3q8ryewYiCgXN3Sz0ziXfmSodR5HGdx9Cce8n1QYdeUHDMeceE0NYXZHaEXM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709198993; c=relaxed/simple; bh=/OH3YPYtC647ehj04e0so/bjPUXbp25AoYAGQn5WjcA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IWytCgqCYza44vl06pAyEnZDbpi9ugyG2bJ41g3oSrXtrl4nJqbPtOw3zSQ0C0F2hyFOcz7K3JNbnqxxNgnxckE/P+hXAbSnOBWerocgCweEyaqzTyuy33JcVBEgovV87lHQ+jG+EMzCYDAqPbC7bL0+3wyqqdRRTr3iGgUXxXw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 24b017bdb2e34ae8b18dac649537834a-20240229 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:080b2373-30c8-484d-a9e2-158fffc50fff,IP:20, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:5 X-CID-INFO: VERSION:1.1.37,REQID:080b2373-30c8-484d-a9e2-158fffc50fff,IP:20,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:5 X-CID-META: VersionHash:6f543d0,CLOUDID:8dbe57ff-c16b-4159-a099-3b9d0558e447,B ulkID:240229172943HMO26OBX,BulkQuantity:0,Recheck:0,SF:38|24|17|19|44|64|6 6|102,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil, BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 24b017bdb2e34ae8b18dac649537834a-20240229 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 619597757; Thu, 29 Feb 2024 17:29:41 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 66BB4E000EBC; Thu, 29 Feb 2024 17:29:41 +0800 (CST) X-ns-mid: postfix-65E04E85-347519924 Received: from [172.20.15.254] (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 40885E000EBC; Thu, 29 Feb 2024 17:28:54 +0800 (CST) Message-ID: Date: Thu, 29 Feb 2024 17:28:53 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] powerpc/mm: Code cleanup for __hash_page_thp To: Michael Ellerman , "Aneesh Kumar K.V" , npiggin@gmail.com, christophe.leroy@csgroup.eu, naveen.n.rao@linux.ibm.com Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20240125092624.537564-1-chentao@kylinos.cn> <87h6hva4b0.fsf@mail.lhotse> <87jzmq5tjr.fsf@mail.lhotse> <87bk80kjup.fsf@kernel.org> <87wmqng5dz.fsf@mail.lhotse> Content-Language: en-US From: Kunwu Chan In-Reply-To: <87wmqng5dz.fsf@mail.lhotse> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks all for the reply. On 2024/2/29 14:18, Michael Ellerman wrote: > Aneesh Kumar K.V writes: >> Michael Ellerman writes: >>> Kunwu Chan writes: >>>> On 2024/2/26 18:49, Michael Ellerman wrote: >>>>> Kunwu Chan writes: >>>>>> This part was commented from commit 6d492ecc6489 >>>>>> ("powerpc/THP: Add code to handle HPTE faults for hugepages") >>>>>> in about 11 years before. >>>>>> >>>>>> If there are no plans to enable this part code in the future, >>>>>> we can remove this dead code. >>>>> >>>>> I agree the code can go. But I'd like it to be replaced with a comment >>>>> explaining what the dead code was trying to say. >>> >>>> Thanks, i'll update a new patch with the following comment: >>>> /* >>>> * No CPU has hugepages but lacks no execute, so we >>>> * don't need to worry about cpu no CPU_FTR_COHERENT_ICACHE feature case >>>> */ >>> >>> Maybe wait until we can get some input from Aneesh. I'm not sure the >>> code/comment are really up to date. >> >> How about? >> >> modified arch/powerpc/mm/book3s64/hash_hugepage.c >> @@ -58,17 +58,13 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid, >> return 0; >> >> rflags = htab_convert_pte_flags(new_pmd, flags); >> + /* >> + * THPs are only supported on platforms that can do mixed page size >> + * segments (MPSS) and all such platforms have coherent icache. Hence we >> + * don't need to do lazy icache flush (hash_page_do_lazy_icache()) on >> + * noexecute fault. >> + */ > I'll use this comment in v2 patch. And add two Suggested-by: label for you. > Yeah thanks that looks good. > > It could say "see eg. __hash_page_4K()", but that's probably unnecessary > as it mentions hash_page_do_lazy_icache(), and anyone interested is just > going to grep for that anyway. > > cheers -- Thanks, Kunwu