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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5E20C433EF for ; Thu, 10 Mar 2022 18:54:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2D8978D0002; Thu, 10 Mar 2022 13:54:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 261418D0001; Thu, 10 Mar 2022 13:54:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B4B08D0002; Thu, 10 Mar 2022 13:54:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E98358D0001 for ; Thu, 10 Mar 2022 13:54:06 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A5030181CA353 for ; Thu, 10 Mar 2022 18:54:06 +0000 (UTC) X-FDA: 79229376492.26.6946F62 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by imf17.hostedemail.com (Postfix) with ESMTP id 366E540020 for ; Thu, 10 Mar 2022 18:54:06 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id s11so5861191pfu.13 for ; Thu, 10 Mar 2022 10:54:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=nfuEjwl5LkiLsK9HWTH2YF9HAWo54N9IjR3Q6dGCh2Y=; b=OsjM2rFOX5y6n0477f/BhUYkTLKVqNTvvOME/UZTjyio0O8pq6jdB14CeKZCtZdadk psC466m6P+ImoHw2nrHgmMs5rTXdalS24lebw9G1KUMCokqIakSa9ssDv/xDZ44NHuH/ BUpyK0IdV/BBWqv7CheOAzgGp3NphpzKS86DRiJh+Uj3pVM4hGX2GhOsn3yLnke9tNEG 7wHT4j23WZwPl8m7SLwbN+nN2O670Zce1jgnZB8G0QOWNHhmzkOfz4D0KLX/If27wQi9 JvFsCELOcH5rKn9hYKEMBP0DDl3oHRfDbXF5QCM46i469QSgcMT9bgcvfDcEOKyHSYYW 3k4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=nfuEjwl5LkiLsK9HWTH2YF9HAWo54N9IjR3Q6dGCh2Y=; b=lg/wj1fEvXsf750TYuxeq2Mm+K2I6mZJN9tFU8MM74B7rF8gxbnRaHI5Xy9yzHjqnG 7SJCChHqgtxrmZBmGzcnLOHMjrILUNgPgMmlu74NjN1mEM4o0MFVLa93s+286Jsp1nDt AgX1FkdmMoIZyyZjn0Az5bq8z55lMcjuX5WQ+DrXtcFeK9ErMaYy3YWchK7Wq03lTQ0s HNgZsDdqtmEqX7PLUSOg90e/5BVlUT1SqAO9GkTrGuf5eEmYV5uUCVGOGdAvwlK/Z0ox sNJ/Wdm1Q7Ew/KEE8QVlbqsqjIqpww6ArDPesJ+Gi6f5X9MytBWdBktBbz6J19aw9T09 Bq3g== X-Gm-Message-State: AOAM533zYXMfjU5zRO/H14qyPMvrmBCan0kGSpxM3OTMTRNiR9eUkhth cK3VMrru7GD9Ccj/20zA6QwbYw== X-Google-Smtp-Source: ABdhPJwHQmRUKvdBq2G3azV3HBa39uDonSnoB+C+1c3DU7NyK0isiEaJrfkE0iFgEWCUkwePj2PALA== X-Received: by 2002:a63:d40f:0:b0:372:a9ec:c027 with SMTP id a15-20020a63d40f000000b00372a9ecc027mr5334208pgh.360.1646938444763; Thu, 10 Mar 2022 10:54:04 -0800 (PST) Received: from [2620:15c:29:204:9181:7c9:2e7e:9306] ([2620:15c:29:204:9181:7c9:2e7e:9306]) by smtp.gmail.com with ESMTPSA id s8-20020a056a0008c800b004f664655937sm8515244pfu.157.2022.03.10.10.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 10:54:04 -0800 (PST) Date: Thu, 10 Mar 2022 10:54:03 -0800 (PST) From: David Rientjes To: David Hildenbrand cc: Zach O'Keefe , Alex Shi , Michal Hocko , Pasha Tatashin , SeongJae Park , Song Liu , Vlastimil Babka , Zi Yan , linux-mm@kvack.org, Andrea Arcangeli , Andrew Morton , Arnd Bergmann , Axel Rasmussen , Chris Kennelly , Chris Zankel , Helge Deller , Hugh Dickins , Ivan Kokshaysky , "James E.J. Bottomley" , Jens Axboe , "Kirill A. Shutemov" , Matthew Wilcox , Matt Turner , Max Filippov , Miaohe Lin , Minchan Kim , Patrick Xia , Pavel Begunkov , Peter Xu , Richard Henderson , Thomas Bogendoerfer , Yang Shi Subject: Re: [RFC PATCH 07/14] mm/khugepaged: add vm_flags_ignore to hugepage_vma_revalidate_pmd_count() In-Reply-To: <30571216-5a6a-7a11-3b2c-77d914025f6d@redhat.com> Message-ID: References: <20220308213417.1407042-1-zokeefe@google.com> <20220308213417.1407042-8-zokeefe@google.com> <30571216-5a6a-7a11-3b2c-77d914025f6d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 366E540020 X-Stat-Signature: uq6zts737kwyg5ihft39hdzup744mom4 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=OsjM2rFO; spf=pass (imf17.hostedemail.com: domain of rientjes@google.com designates 209.85.210.181 as permitted sender) smtp.mailfrom=rientjes@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-HE-Tag: 1646938446-684416 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: On Thu, 10 Mar 2022, David Hildenbrand wrote: > On 08.03.22 22:34, Zach O'Keefe wrote: > > In madvise collapse context, we optionally want to be able to ignore > > advice from MADV_NOHUGEPAGE-marked regions. > > > > Add a vm_flags_ignore argument to hugepage_vma_revalidate_pmd_count() > > which can be used to ignore vm flags used when considering thp > > eligibility. > > arch/s390/mm/gmap.c:thp_split_mm() sets VM_NOHUGEPAGE to make sure there > are *really* no thp. Being able to bypass that would break KVM horribly. > > Ignoring MADV_NOHUGEPAGE/VM_NOHUGEPAGE feels like the wrong way to go. > Agreed, we'll have to remove this possibility. > What about a prctl instead, to disable any khugepagd activity and just > let that process control it manually? > No objection to the prctl, although it's unfortunate that the existing PR_SET_THP_DISABLE simply disables thp for the process entirely for any non-zero value and that this wasn't implemented as a bitmask to specify future behavior where this new behavior could be defined :/ I'll note, however, that we'd have no immediate use case ourselves for the prctl, although others may. Our approach will likely be to disable khugepaged entirely in favor of outsourcing hugepage policy decisions to userspace based on a number of different signals. (In fact, also doing thp enabled = madvise system wide)