From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755546AbcIELzG (ORCPT ); Mon, 5 Sep 2016 07:55:06 -0400 Received: from g9t1613g.houston.hpe.com ([15.241.32.99]:11172 "EHLO g9t1613g.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755465AbcIELy6 (ORCPT ); Mon, 5 Sep 2016 07:54:58 -0400 Subject: Re: [RFC PATCH v2 2/3] xpfo: Only put previous userspace pages into the hot cache To: Dave Hansen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-hardening@lists.openwall.com, linux-x86_64@vger.kernel.org References: <1456496467-14247-1-git-send-email-juerg.haefliger@hpe.com> <20160902113909.32631-1-juerg.haefliger@hpe.com> <20160902113909.32631-3-juerg.haefliger@hpe.com> <57C9E37A.9070805@intel.com> Cc: vpk@cs.columbia.edu From: Juerg Haefliger Message-ID: Date: Mon, 5 Sep 2016 13:54:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <57C9E37A.9070805@intel.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="feNkja7ck77XjJ8qB7LALqg0b3p8XSw7t" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --feNkja7ck77XjJ8qB7LALqg0b3p8XSw7t Content-Type: multipart/mixed; boundary="HHOVQnPV2XNCXH9POK17P2Fj5EiJGnEta"; protected-headers="v1" From: Juerg Haefliger To: Dave Hansen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-hardening@lists.openwall.com, linux-x86_64@vger.kernel.org Cc: vpk@cs.columbia.edu Message-ID: Subject: Re: [RFC PATCH v2 2/3] xpfo: Only put previous userspace pages into the hot cache References: <1456496467-14247-1-git-send-email-juerg.haefliger@hpe.com> <20160902113909.32631-1-juerg.haefliger@hpe.com> <20160902113909.32631-3-juerg.haefliger@hpe.com> <57C9E37A.9070805@intel.com> In-Reply-To: <57C9E37A.9070805@intel.com> --HHOVQnPV2XNCXH9POK17P2Fj5EiJGnEta Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 09/02/2016 10:39 PM, Dave Hansen wrote: > On 09/02/2016 04:39 AM, Juerg Haefliger wrote: >> Allocating a page to userspace that was previously allocated to the >> kernel requires an expensive TLB shootdown. To minimize this, we only >> put non-kernel pages into the hot cache to favor their allocation. >=20 > But kernel allocations do allocate from these pools, right? Yes. > Does this > just mean that kernel allocations usually have to pay the penalty to > convert a page? Only pages that are allocated for userspace (gfp & GFP_HIGHUSER =3D=3D GF= P_HIGHUSER) which were previously allocated for the kernel (gfp & GFP_HIGHUSER !=3D GFP_HIGHUSER= ) have to pay the penalty. > So, what's the logic here? You're assuming that order-0 kernel > allocations are more rare than allocations for userspace? The logic is to put reclaimed kernel pages into the cold cache to postpon= e their allocation as long as possible to minimize (potential) TLB flushes. =2E..Juerg --HHOVQnPV2XNCXH9POK17P2Fj5EiJGnEta-- --feNkja7ck77XjJ8qB7LALqg0b3p8XSw7t Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXzV0HAAoJEHVMOpb5+LSM304QAINSMlOQKNAIRon29Uy318Sf J9Vfv3p2L/WIxrL6kKaHYkDqj+b0XnSVlWvnxNp1MX1qAOqeUSipfymvwNaYGuIV IJQeahOcJccupJMw1ILF+H1Rhxn+gBOc9I745omwO/CtlqYaYaXfCeIxI/R1Q9LQ yCtBPnbL4v1St7FnjDhZd3FdgiP+F98MAz8040FYq1cO+qWVDTyIRcpq4rPaAJNi 8zcpLB+A34qjA2i3ZFV/ZNls2L4Buw4pYW1ZGnHxNTKKmbrYkZhBuxYuCNpfnyhB M00AnBKJQ7fqHKxCa64eo59rRTpYQ0Zd8KaKvVaZfZfbBaAg8Ir2UWNoBcPvE8ox D8TMhKlORMhHfnAE73DIlkENt1wYt2gGGScIJ+bL8nulJpqvNo5lPyTT3NHhrNZa prre5DzDQFvyv2SLx2P3MDqtyJ658hKx5own+82N99K5GuhC2++Xaq3/BpOC4rQI rEONoXhm0j63g2udCmkc1BIRSb+ZTaqzC1fxWoYH75nYEiIhGcgTQVJWXMx5DB/Y gvJJn/okC97zSXGk8zQtYIO2aDhUzRowYoy5bslzlR20hoNTWL9ctySE2OobqIdM WmWm/Hyq59cAMneimMv68+/RiWtxL2s5Q+8lci8uf18ollN1g/zp6H/1qOOMWvAr vqBZxyugEM72PbSEFv8Y =Jva/ -----END PGP SIGNATURE----- --feNkja7ck77XjJ8qB7LALqg0b3p8XSw7t--