From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 F34841C07CF for ; Fri, 20 Dec 2024 11:18:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734693535; cv=none; b=ounk/K0lRX/OkxO522JPJO+cuXSJ9ynDvz2lo+0OwUkNV8xtlQfwV+GlgwiQVl4xYZEwqcb8UEo1mcpQNdTm//GyPV70cZX3VmQED3P4frRG6dzIRav6Dxe/POGbpblSe4LQtUqYKu0k8+f33RNo7RnMctluwW19vKgnlBxWK0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734693535; c=relaxed/simple; bh=64Ihm8i+wjuREegZ9JhXRDIiXDdLTVCjF2+e/5TQt0M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G7cj7bV8qkCEAVckn1s34TaM3E5rKqBG/9e826AgnFq3Bitb4PIPya9b6gnEhfERNFSaPY3GNf/SsyksA+/CG8lTqKEnXfF5TKYMVK1T0+/xB8jlZ0IQrPf0jZNmcN+BRwGaTtRK+UWeuZv+cvOIgp0FMz8jKuIlv5wyrSu2+5w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=i+eYY57H; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="i+eYY57H" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BKBHBW0001729; Fri, 20 Dec 2024 11:18:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pp1; bh=VTDoWcoQ1Do43bcRpkcFPTXrbalVP/ zSadlkqOn9knA=; b=i+eYY57H80CgDLd+GtmG83AtQ8gUebNW5gwk7bYNKSxCFh H96pOw3wB20vEkivfAnhdA9NeJNZtgNMQibneXcaV1CJlPm0dWXljf36nYGF81CB h1CXnNyelhWYJMWjhx2nOoDTN7RUoV3kTd98BP5AwdWARKXZlw3lcMcGxgCsFlUj beulLhkRa7+ZUNG66bA+UnwuLbhdfYALeqgniU+iBhwDidVhGuvH1NUrIiE7cepp uCuivmm66VtkSdsCAaZuH4qSTzY9+t4PsLLotE+/vMfu6+vu2qX/69kMa3Wqb8Wh 48Qq432Bg96elH1tPwU3QULjj6cd29PygbFBQLVw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43mwmhjf0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Dec 2024 11:18:27 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4BKBF90t021621; Fri, 20 Dec 2024 11:18:27 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43mwmhjf0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Dec 2024 11:18:27 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4BK6recE014383; Fri, 20 Dec 2024 11:18:26 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 43hq221fy9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Dec 2024 11:18:26 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BKBIOfM52953592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Dec 2024 11:18:24 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6EFBC2004F; Fri, 20 Dec 2024 11:18:24 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3721C2004D; Fri, 20 Dec 2024 11:18:24 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 20 Dec 2024 11:18:24 +0000 (GMT) Date: Fri, 20 Dec 2024 12:18:20 +0100 From: Alexander Gordeev To: Qi Zheng Cc: peterz@infradead.org, tglx@linutronix.de, david@redhat.com, jannh@google.com, hughd@google.com, yuzhao@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, lorenzo.stoakes@oracle.com, akpm@linux-foundation.org, rientjes@google.com, vishal.moola@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 11/15] mm: pgtable: introduce generic __tlb_remove_table() Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: DHEMKeKCdeKwBgc4veY0RuU36n0nJgmE X-Proofpoint-GUID: rKiFh2Wu-Nx3Rfnfo2M_cEQgn4CjyLpE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 malwarescore=0 adultscore=0 mlxlogscore=529 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412200091 On Wed, Dec 18, 2024 at 09:04:47PM +0800, Qi Zheng wrote: > Several architectures (arm, arm64, riscv, s390 and x86) define exactly the > same __tlb_remove_table(), just introduce generic __tlb_remove_table() to > eliminate these duplications. s390 is nearly the same, but not exactly (see below). > arch/s390/include/asm/tlb.h | 1 - > arch/s390/mm/pgalloc.c | 7 ------- ... > --- a/arch/s390/mm/pgalloc.c > +++ b/arch/s390/mm/pgalloc.c > @@ -193,13 +193,6 @@ void page_table_free(struct mm_struct *mm, unsigned long *table) > pagetable_dtor_free(ptdesc); > } > > -void __tlb_remove_table(void *table) > -{ > - struct ptdesc *ptdesc = virt_to_ptdesc(table); > - > - pagetable_dtor_free(ptdesc); With this change you introduce these duplication in __tlb_remove_table() and in pagetable_dtor_free(): pagetable_dtor(ptdesc); pagetable_free(ptdesc); But I still would prefer to avoid __HAVE_ARCH_TLB_REMOVE_TABLE. Could it be possible to move pagetable_dtor_free() to asm-generic and make s390 __tlb_remove_table() version generic? > -} > - > #ifdef CONFIG_TRANSPARENT_HUGEPAGE > static void pte_free_now(struct rcu_head *head) > { Thanks!