Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7422581ybn; Mon, 30 Sep 2019 13:41:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHE4kcDt6HJtn3qB5RyWDMFQUN4y7LBJQMV3ltUaFQPBbTLyrUSVurc0Xy0r6Ueh2zhQl7 X-Received: by 2002:a17:906:7a0d:: with SMTP id d13mr21193892ejo.242.1569876105679; Mon, 30 Sep 2019 13:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569876105; cv=none; d=google.com; s=arc-20160816; b=lNSXwiXr1MAb/GCHsL0y99UqsNWNK60BJq20sRngZNOVOuy/qcjc63kOqUu04YUd7o nxfia+i2BRRUVqPGrcWJxrQ7frwFu9laoh+w3b2/yafG9T1JCsQUk7U1odK/LkuQPNXW nR4TwDgk/39tAq5MAP/ObcyH2WqkmeIS/6olASzZEVtVnU2hTyM3VSf9teXOo0WThexN ckeL8VIj9i6yZfIPUqW1UMbwDibUEu5Uucm/Ww3FHaDwaHQfi4yRqp4e+095bprf24OL UxUQyXFywfWwwfQu61nhwj1CnDQX40VWbGJQacaR8rqOF8pA+i0avxITVzck9iuJ1/bW rBNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=xZhGhCoGLeaHt//kaLNKOm2Yi1ipfZhXS/4xBId+5TY=; b=Dg9cd+0Q0uwcXaHS90QdQwbjnr3wOnJKFsITrFzAGyTo9QihMOfQyirLSs3tYKLO6E IeQZflCddkvsuTIEXj3v6iGL7w0jiPC0dYZO0WDOhNYn/A6R4Z/quK9MtJIp7Uemcyyx 6KuRp/jsTvUbdqzWj1cy2d8IBA5iQuIxOXhK2OT+k2o2AE5ynycAmlVeYhZhLkthf5H6 xEzmWcfghwdY1Pgi7fEE+jDDgksZ/nRGL16zzcQfIAqwS+PF7b0GCOMAoucFrG/coDvO baN2/mwJUP6Bc7vP0J25Ok3RmaNlM1+R6mN1i0z1cKBlFfDkcHxFhrU97ucGMbs1+X1H 9xTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 90si9073292edj.72.2019.09.30.13.41.06; Mon, 30 Sep 2019 13:41:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726761AbfI3Ugq (ORCPT + 99 others); Mon, 30 Sep 2019 16:36:46 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:29744 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727885AbfI3Ugp (ORCPT ); Mon, 30 Sep 2019 16:36:45 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8UId4Tb128798; Mon, 30 Sep 2019 14:42:54 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2vbnbpvx6j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Sep 2019 14:42:54 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8UIdGG7129741; Mon, 30 Sep 2019 14:42:53 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com with ESMTP id 2vbnbpvx5w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Sep 2019 14:42:53 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8UIextj010451; Mon, 30 Sep 2019 18:42:52 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02wdc.us.ibm.com with ESMTP id 2v9y57w08c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Sep 2019 18:42:52 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8UIgpxs59310430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Sep 2019 18:42:51 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 54C7EBE056; Mon, 30 Sep 2019 18:42:51 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D281EBE04F; Mon, 30 Sep 2019 18:42:46 +0000 (GMT) Received: from leobras.br.ibm.com (unknown [9.18.235.58]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 30 Sep 2019 18:42:46 +0000 (GMT) Message-ID: <673bcb94b7752e086cc4133fb6cceb24394c02c0.camel@linux.ibm.com> Subject: Re: [PATCH v4 01/11] powerpc/mm: Adds counting method to monitor lockless pgtable walks From: Leonardo Bras To: John Hubbard , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Cc: Arnd Bergmann , Greg Kroah-Hartman , YueHaibing , Nicholas Piggin , Mike Rapoport , Keith Busch , Jason Gunthorpe , Paul Mackerras , "Aneesh Kumar K.V" , Allison Randal , Mahesh Salgaonkar , Ganesh Goudar , Thomas Gleixner , Ira Weiny , Andrew Morton , Dan Williams Date: Mon, 30 Sep 2019 15:42:42 -0300 In-Reply-To: <48bf32ca-5d3e-5d69-4cd1-6720364a0d81@nvidia.com> References: <20190927234008.11513-1-leonardo@linux.ibm.com> <20190927234008.11513-2-leonardo@linux.ibm.com> <4ff1e8e8-929b-9cfc-9bf8-ee88e34de888@nvidia.com> <2533a13f226a6e1fab387669b6cced2aa8d2e129.camel@linux.ibm.com> <48bf32ca-5d3e-5d69-4cd1-6720364a0d81@nvidia.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-9k3sG6ksgKhuBdahGQJu" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-30_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909300166 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-9k3sG6ksgKhuBdahGQJu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2019-09-30 at 10:57 -0700, John Hubbard wrote: > > As I told before, there are cases where this function is called from > > 'real mode' in powerpc, which doesn't disable irqs and may have a > > tricky behavior if we do. So, encapsulate the irq disable in this > > function can be a bad choice. >=20 > You still haven't explained how this works in that case. So far, the > synchronization we've discussed has depended upon interrupt disabling > as part of the solution, in order to hold off page splitting and page > table freeing. The irqs are already disabled by another mechanism (hw): MSR_EE=3D0. So, serialize will work as expected. > Simply skipping that means that an additional mechanism is required...whi= ch > btw might involve a new, ppc-specific routine, so maybe this is going to = end > up pretty close to what I pasted in after all... > > Of course, if we really need that, we can add a bool parameter to the > > function to choose about disabling/enabling irqs. > > > * This is really a core mm function, so don't hide it away in arch la= yers. > > > (If you're changing mm/ files, that's a big hint.) > >=20 > > My idea here is to let the arch decide on how this 'register' is going > > to work, as archs may have different needs (in powerpc for example, we > > can't always disable irqs, since we may be in realmode). > >=20 > > Maybe we can create a generic function instead of a dummy, and let it > > be replaced in case the arch needs to do so. >=20 > Yes, that might be what we need, if it turns out that ppc can't use this > approach (although let's see about that). >=20 I initially used the dummy approach because I did not see anything like serialize in other archs.=20 I mean, even if I put some generic function here, if there is no function to use the 'lockless_pgtbl_walk_count', it becomes only a overhead. >=20 > thanks, Thank you! --=-9k3sG6ksgKhuBdahGQJu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEMdeUgIzgjf6YmUyOlQYWtz9SttQFAl2STKIACgkQlQYWtz9S ttSxFg//Uqx1dqwNpWXo7xp/0GswLDO2WKQanbx0Qg4JKCL09MHD8khl2E9vx4IF Icd6eXFRwYdzgdFfGKCCUpE9dEBMkT9zPeDS7tk8jhbZ57yJtXC3X3Pcx7j82bEO n1x5ZL2jrTEqoWL4oYegJmVi7zzdHiGJi0O31QDIp9YGFdxUn2lPUCNMaypuLs/u vejkf6DcmVUXCigXaxmT5NN85fDDUJxbph79+UXyEm6jy9Zuk+PSi3AgfmkCKftk RdyU8pmX875qMJQGvoOAIaX/GBavIFVvujG9x7HBeL26G0pdttO0b/1nt5A3thWi nx2y4jlfzoDvLhAfw4wsZ+zHQjzIIZlpdM1SaDseb5mNyR1+fpTPoqhsAtqcex6N +LdR2q+osgMfKpklWyAhSgJVIqvvtViBEqmA5Itg4JOzQD0xJwg27DJjTd0mBv1E za5iWYaUxBs4qw8W98gwSbw2lKgIRfKieKynDUwdSmq8GwjCSj7H9Iuvr/aQwGnm E8o41KiK7frirDuS6jxdBYPvA3mtUqqVCN3pXZKktEc3CrZSd9C/J7AR5b+UZJOi Umdeci9BnKsx2kFvCsrdcl6DEkmKELiVjJ+aDtZBbunKnwKtupCRE2UC4X2UE02y Z9Mdw6OCS6VH+s+ArHVohA6MNm8+5OzhJdZV4oHv/EO5esStUTM= =VegT -----END PGP SIGNATURE----- --=-9k3sG6ksgKhuBdahGQJu--