From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28C7CC4360C for ; Tue, 8 Oct 2019 17:14:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C6026206C2 for ; Tue, 8 Oct 2019 17:14:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6026206C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3B8DC8E0006; Tue, 8 Oct 2019 13:14:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 342398E0003; Tue, 8 Oct 2019 13:14:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E3908E0006; Tue, 8 Oct 2019 13:14:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id EC6178E0003 for ; Tue, 8 Oct 2019 13:14:39 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 9DE26180AD804 for ; Tue, 8 Oct 2019 17:14:39 +0000 (UTC) X-FDA: 76021266678.14.bone94_7fe94ddefc355 X-HE-Tag: bone94_7fe94ddefc355 X-Filterd-Recvd-Size: 7801 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Tue, 8 Oct 2019 17:14:38 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x98GvAUp132403; Tue, 8 Oct 2019 13:14:12 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2vgujcfyj1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2019 13:14:12 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x98GvNPm132979; Tue, 8 Oct 2019 13:14:11 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 2vgujcfyh2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2019 13:14:11 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x98GtUGH015110; Tue, 8 Oct 2019 17:14:10 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma03wdc.us.ibm.com with ESMTP id 2vejt6tx3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2019 17:14:10 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x98HE8xU57934258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2019 17:14:08 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 527E3C605F; Tue, 8 Oct 2019 17:14:08 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53536C605A; Tue, 8 Oct 2019 17:14:00 +0000 (GMT) Received: from leobras.br.ibm.com (unknown [9.18.235.46]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2019 17:14:00 +0000 (GMT) Message-ID: <6e8877bff034603e75b35599797a39d9bc4840f1.camel@linux.ibm.com> Subject: Re: [PATCH v5 02/11] powerpc/mm: Adds counting method to monitor lockless pgtable walks From: Leonardo Bras To: Christopher Lameter Cc: Song Liu , Michal Hocko , "Peter Zijlstra (Intel)" , "Dmitry V. Levin" , Keith Busch , linux-mm@kvack.org, Paul Mackerras , Christian Brauner , Ira Weiny , Dan Williams , Elena Reshetova , linux-arch@vger.kernel.org, Santosh Sivaraj , Davidlohr Bueso , "Aneesh Kumar K.V" , Bartlomiej Zolnierkiewicz , Mike Rapoport , Jason Gunthorpe , Vlastimil Babka , Mahesh Salgaonkar , Andrey Ryabinin , Alexey Dobriyan , Ingo Molnar , Andrea Arcangeli , Ralph Campbell , Arnd Bergmann , Jann Horn , John Hubbard , Jesper Dangaard Brouer , Nicholas Piggin , =?ISO-8859-1?Q?J=E9r=F4me?= Glisse , Mathieu Desnoyers , kvm-ppc@vger.kernel.org, Thomas Gleixner , Reza Arbab , Allison Randal , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Logan Gunthorpe , Souptick Joarder , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Roman Gushchin , "Kirill A. Shutemov" , Al Viro Date: Tue, 08 Oct 2019 14:13:55 -0300 In-Reply-To: References: <20191003013325.2614-1-leonardo@linux.ibm.com> <20191003013325.2614-3-leonardo@linux.ibm.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-JXyt1yOsMJO5qRHMDgfG" 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-10-08_06:,, 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-1910080140 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --=-JXyt1yOsMJO5qRHMDgfG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2019-10-08 at 15:11 +0000, Christopher Lameter wrote: >=20 > On Wed, 2 Oct 2019, Leonardo Bras wrote: >=20 > > + > > +inline unsigned long __begin_lockless_pgtbl_walk(struct mm_struct *mm, > > + bool disable_irq) > > +{ > > + unsigned long irq_mask =3D 0; > > + > > + if (IS_ENABLED(CONFIG_LOCKLESS_PAGE_TABLE_WALK_TRACKING)) > > + atomic_inc(&mm->lockless_pgtbl_walkers); > > + >=20 > You are creating contention on a single exclusive cacheline. Doesnt this > defeat the whole purpose of the lockless page table walk? Use mmap_sem or > so should cause the same performance regression? Sorry, I did not understand that question. I mean, this is just a refcount and never causes a lock. =20 FYI: This function was updated as following, and will be in v6: #ifdef CONFIG_LOCKLESS_PAGE_TABLE_WALK_TRACKING atomic_inc(&mm->lockless_pgtbl_walkers); #endif smp_mb(); IS_ENABLED doesnt work fine if CONFIG_LOCKLESS_PAGE_TABLE_WALK_TRACKING is not defined, causing an error: the mm member lockless_pgtbl_walkers doesn't exist. --=-JXyt1yOsMJO5qRHMDgfG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEMdeUgIzgjf6YmUyOlQYWtz9SttQFAl2cw9MACgkQlQYWtz9S ttQJpQ/+NQnm5YZrjCiFby0X7Zf2c6QdSw96EfXRY6oxh//DMzzC+U3jhpEDpGKA QjRsZiDRIdHhVHWVPkC9Oz76ThRYBaFSjhs7l06K7asP0KaXFDxv6XInJ2dlqqQW GSHmRaqDBbr9ndUaJz3J4CbU05jsEwCrmku7O5BhBejtYoKAQBvHFuFVcO71A1YW hH92tSFBR39N6SADoVVxDwpSd2ryeK3k0czeLxeekENyCxmRk6HgBUKHcwSMP0d3 rRDpJ+IVWqIja+43DjknTGYq4xGXYnfFzYfdQIaqhc+rNWyKJ3C07/5zhMteVJqk ycMJ39kFL66uO/J24Cr0DKo9W2VcdwxEQ1a+W2/4FeayI8QT3IgN0WqcMXcnfG/K ahVV6S/gliueptjZWgWy62jnEXMbWzHLtVMTlzjxYyLGzOe64Lsa6lt054VcIws5 DstylhjC6HOURSZ5c9IChKdavw5QOvRTjoq/stxswR1D05USHVWKrXxyCewY7eSo 7AEnUmOAXpWmem81q+VAFYq4UrOlkknz4gZkhotkUdcfHs+y6hwzTzfh4SzifFxq QC8cXCtmkrurkVjRDLxSt/6vkemBBouw9ug2EExB8fDHdC5m8O2brErMC2iL5ppx bG7LtF0rTIqLrfRxpgctebsZ8yRZBV0aMAjbxi/pPOu8egZzHeY= =Nht8 -----END PGP SIGNATURE----- --=-JXyt1yOsMJO5qRHMDgfG--