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=-3.8 required=3.0 tests=BAYES_00, 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 CBFC3C5519F for ; Sat, 14 Nov 2020 03:44:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4BE9022284 for ; Sat, 14 Nov 2020 03:44:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BE9022284 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A43E36B005C; Fri, 13 Nov 2020 22:44:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F4A36B005D; Fri, 13 Nov 2020 22:44:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8BCFD6B0068; Fri, 13 Nov 2020 22:44:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0247.hostedemail.com [216.40.44.247]) by kanga.kvack.org (Postfix) with ESMTP id 5CA6B6B005C for ; Fri, 13 Nov 2020 22:44:24 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 05FEF34A3 for ; Sat, 14 Nov 2020 03:44:24 +0000 (UTC) X-FDA: 77481631248.23.mask21_1601d0827314 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id CACDE37606 for ; Sat, 14 Nov 2020 03:44:23 +0000 (UTC) X-HE-Tag: mask21_1601d0827314 X-Filterd-Recvd-Size: 3913 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Sat, 14 Nov 2020 03:44:23 +0000 (UTC) Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kdmU8-0001JI-Om; Fri, 13 Nov 2020 22:44:20 -0500 Message-ID: <84effe90c3ee13fbfa6e732d2e3b3d9b557d1be1.camel@surriel.com> Subject: Re: [PATCH 1/2] mm,thp,shmem: limit shmem THP alloc gfp_mask From: Rik van Riel To: Michal Hocko Cc: hughd@google.com, xuyu@linux.alibaba.com, akpm@linux-foundation.org, mgorman@suse.de, aarcange@redhat.com, willy@infradead.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, vbabka@suse.cz Date: Fri, 13 Nov 2020 22:44:20 -0500 In-Reply-To: <20201112105258.GZ12240@dhcp22.suse.cz> References: <20201105191508.1961686-1-riel@surriel.com> <20201105191508.1961686-2-riel@surriel.com> <20201112105258.GZ12240@dhcp22.suse.cz> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-otlc1Hj05zsRUDVw4HK7" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 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: --=-otlc1Hj05zsRUDVw4HK7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2020-11-12 at 11:52 +0100, Michal Hocko wrote: > On Thu 05-11-20 14:15:07, Rik van Riel wrote: > >=20 > > This patch applies the same configurated limitation of THPs to > > shmem > > hugepage allocations, to prevent that from happening. >=20 > I believe you should also exaplain why we want to control defrag by > the > global knob while the enable logic is per mount. I added that to the changelog for the next version of the patches. > > This way a THP defrag setting of "never" or "defer+madvise" will > > result > > in quick allocation failures without direct reclaim when no 2MB > > free > > pages are available. > >=20 > > With this patch applied, THP allocations for tmpfs will be a little > > more aggressive than today for files mmapped with MADV_HUGEPAGE, > > and a little less aggressive for files that are not mmapped or > > mapped without that flag. >=20 > This begs some numbers. A little is rather bad unit of performance. I > do > agree that unifying those makes sense in general though. The aggressiveness is in changes to the gfp_mask, eg by adding __GFP_NORETRY. How that translates into THP allocation success rates is entirely dependent on the workload and on what else is in memory at the time. I am not sure any numbers I could gather will be representative for anything but the workloads I am testing. However, I did find an issue in hugepage_vma_check that prevents khugepaged from collapsing pages on shmem filesystems mounted with huge=3Dalways or huge=3Dwithin_size when transparent_hugepage/enabled is set to [madvise]. The next version of the series will have a third patch, in order to fix that. --=20 All Rights Reversed. --=-otlc1Hj05zsRUDVw4HK7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl+vUpQACgkQznnekoTE 3oMiXAgAqQFQLZCkPNXA5l/N7WEMWji2pTMavF9GX5YIzJD5EowvnAUv4EQvyFFN ZMYSkoHVvQSHiT3OqdrWMXEgx/FJU1aSj0DQX9GWYtA8QLR30WeDReqmlD6P//Ud FB37RuszfWHMh/hSdtrk0BrvSVtPAxEiFitPFEsek8WRTUIkMaaiwigIcrL77ooB 5Q1AuNhA4UplVmdG3dZlHB6J8ECPIYkSk/bmYviraDmwqFW17tkUwzl+S6cBGncd Ay0TmrHQvII+a+HCdT11I1QJlgp4dDMg2Cbc2VEVK0pZoAsEGuyS3j0bPRxoxV3u 6Hd4G/mGZhXxPuVoMxKx8z2hFAB8Lg== =ZErD -----END PGP SIGNATURE----- --=-otlc1Hj05zsRUDVw4HK7--