Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2865053iob; Mon, 16 May 2022 07:52:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqTCt0lVqEyJi3gKN2WIi6FdWRQxQGKto53tbfKg1MD77ak9I2ib6j6r98hhVW+kcr5W0W X-Received: by 2002:a17:906:6a0e:b0:6f5:30c9:7c7d with SMTP id qw14-20020a1709066a0e00b006f530c97c7dmr15209083ejc.63.1652712761684; Mon, 16 May 2022 07:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652712761; cv=none; d=google.com; s=arc-20160816; b=N8WpU3XVILQ048eLAp5FRW4JETUYrWbnAjVsu4LMYeRJfIQ92BhrdOo/VrcoGWTMMT //57Yvd+X+xbdgK496yrHNehVHxTB1tj3o3Pn8l7dCeSoSUuMvU641ptUCH0O51YoYOb 91iQiot3N4rL+8bf5UmLMjndzQcGCOW4Fds+739Hk/AUcDGL7QUlc/V1+U4kjhsN2wMB GIz8NOaNyuFVkdJdkdDAaXC29fVDSdy32TMavg38sZrZZaBe79XDGAjLeASizxzdIs0q AOOny1KKq7XKpanfeHEniYQ0O4CBRZ/jwvt/M4vrPc85CjavlWbpv8sbVE+f/QUUwC1Z wnsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=4cG4fZ4FABvZZmQJ6VpIHom+4B7L/DL86KLk4eOIYK4=; b=RvnjAfQPNOL/OBDfDrR1d9KJZAi7wsouPRUZadf7PJszO9f3FYS6FfVV8mCmlpnVZV BMuc1mjmaa2Ls3N29r/7+gKYKwTR/3kBBrnHqAbS5sQE+AFd7OuqJwUWOkornkg38Nmx rMBAJujJ8T4isTArhebhZbojixI6m/otUw4ZXgfWJRBfUlx3W2dxXiqzGq8Y6759p0WN ojCgNqTNCskTWsS7zCFlfRRMUsnWN+YkvF+IkiLsLMPrVgbo3EbAKFNA1pvY97xMbx2J r3won7xrLqM2bt5DxxhjYpSmZojq12LDY0ftsPgI0Ly2ajlmew8agjTTdFWIFvSI9PTw 8q1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=KESwY1s3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b16-20020a056402351000b00425e87ced9esi11892327edd.512.2022.05.16.07.52.16; Mon, 16 May 2022 07:52:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=KESwY1s3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241487AbiEPIFH (ORCPT + 99 others); Mon, 16 May 2022 04:05:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238262AbiEPIFD (ORCPT ); Mon, 16 May 2022 04:05:03 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CACC31233; Mon, 16 May 2022 01:05:02 -0700 (PDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24G7NGuB015125; Mon, 16 May 2022 08:05:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=pp1; bh=4cG4fZ4FABvZZmQJ6VpIHom+4B7L/DL86KLk4eOIYK4=; b=KESwY1s3+VdVLFp5m7r5ueiRBHWfYIW9lCKb8DQqsNasuHN6KC1jPJpZuQ57/dcw9+mv nmPGIc10MBMsLfax3HWFI+ldKsxm5uN9liBaruv8gAuCW+B0hQXgGCjk1QNiEqJiXtEt ZudQn8a2EXfL4XIdmRGMNiFeyNK2viyz+gXeMB25XY0d0gVgUsMlyso9WS3F2mHDLqTM KtD4H2TZ1vQ3SttgT2Vkz6G8HulnBR4j+SjJhba081bF4sT8TvS9DxRbp7QBC5XIl2c0 76fv9f4E5mnck4BSS8Zs0fVuNerVN5OCyz3w4LiU20m8A3KDttQ0zUijKSNsb6D2nkRM Pg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3g3ey0c66c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 May 2022 08:05:01 +0000 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24G7a1bS019675; Mon, 16 May 2022 08:05:00 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3g3ey0c65u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 May 2022 08:05:00 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24G84EdZ016964; Mon, 16 May 2022 08:04:58 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma02fra.de.ibm.com with ESMTP id 3g2428hrr8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 May 2022 08:04:58 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24G84t6Y49480168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 May 2022 08:04:55 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A3B611C054; Mon, 16 May 2022 08:04:55 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D55ED11C04A; Mon, 16 May 2022 08:04:54 +0000 (GMT) Received: from li-ca45c2cc-336f-11b2-a85c-c6e71de567f1.ibm.com (unknown [9.171.50.122]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 16 May 2022 08:04:54 +0000 (GMT) Message-ID: <6948806da404fd5822b59fd65b8a5a948e6bb317.camel@linux.ibm.com> Subject: Re: [PATCH v10 04/19] KVM: s390: pv: refactor s390_reset_acc From: Nico Boehr To: Claudio Imbrenda , kvm@vger.kernel.org Cc: borntraeger@de.ibm.com, frankja@linux.ibm.com, thuth@redhat.com, pasic@linux.ibm.com, david@redhat.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, scgl@linux.ibm.com, mimu@linux.ibm.com Date: Mon, 16 May 2022 10:04:54 +0200 In-Reply-To: <20220414080311.1084834-5-imbrenda@linux.ibm.com> References: <20220414080311.1084834-1-imbrenda@linux.ibm.com> <20220414080311.1084834-5-imbrenda@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1 (3.44.1-1.fc36) MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: lsqWKg8fXlQr6SI_X27VJGgdaVMjHLwB X-Proofpoint-GUID: z3XyIGc9s1xEsN7Too8IHn4CIxKRVTGW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-16_03,2022-05-13_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 spamscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205160045 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2022-04-14 at 10:02 +0200, Claudio Imbrenda wrote: > Refactor s390_reset_acc so that it can be reused in upcoming patches. >=20 > We don't want to hold all the locks used in a walk_page_range for too > long, and the destroy page UVC does take some time to complete. > Therefore we quickly gather the pages to destroy, and then destroy > them > without holding all the locks. >=20 > The new refactored function optionally allows to return early without > completing if a fatal signal is pending (and return and appropriate > error code). Two wrappers are provided to call the new function. >=20 > Signed-off-by: Claudio Imbrenda > Reviewed-by: Janosch Frank Reviewed-by: Nico Boehr But see below with one naming suggestion you might want to take into account. [...] > diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c > index e8904cb9dc38..a3a1f90f6ec1 100644 > --- a/arch/s390/mm/gmap.c > +++ b/arch/s390/mm/gmap.c > @@ -2676,44 +2676,81 @@ void s390_reset_cmma(struct mm_struct *mm) > =C2=A0} > =C2=A0EXPORT_SYMBOL_GPL(s390_reset_cmma); > =C2=A0 > -/* > - * make inaccessible pages accessible again > - */ > -static int __s390_reset_acc(pte_t *ptep, unsigned long addr, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 unsigned long next, struct mm_walk *walk) > +#define DESTROY_LOOP_THRESHOLD 32 maybe GATHER_NUM_PAGE_REFS_TO_TAKE?