From: Leonardo Bras Date: Mon, 30 Sep 2019 18:42:42 +0000 Subject: Re: [PATCH v4 01/11] powerpc/mm: Adds counting method to monitor lockless pgtable walks Message-Id: <673bcb94b7752e086cc4133fb6cceb24394c02c0.camel@linux.ibm.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-9k3sG6ksgKhuBdahGQJu" List-Id: 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> In-Reply-To: <48bf32ca-5d3e-5d69-4cd1-6720364a0d81@nvidia.com> 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 --=-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--