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 71AA0C433EF for ; Mon, 21 Mar 2022 14:27:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E176B6B0072; Mon, 21 Mar 2022 10:27:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D9EEA6B0073; Mon, 21 Mar 2022 10:27:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF2E16B0074; Mon, 21 Mar 2022 10:27:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id B0E246B0072 for ; Mon, 21 Mar 2022 10:27:16 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 768A01800 for ; Mon, 21 Mar 2022 14:27:16 +0000 (UTC) X-FDA: 79268620872.01.BAC487D Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf30.hostedemail.com (Postfix) with ESMTP id E03628000C for ; Mon, 21 Mar 2022 14:27:15 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 8300F1F37C; Mon, 21 Mar 2022 14:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1647872834; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=546lbXZptadGnKfGcWnwFSmtqJ/RTwl0W3BFA4lwqkU=; b=tZHaNtpVCv10qXpyXZVkBCBjBqwEmMFA7kVwXOuXgbXxCmFaxjKEuqZoNK+QwjAAn1U773 00iwE94yjCjxvHxKzhXWz9HHFur3OwTURpknU8uy0aNHPT6hx1VWKjMrT5omb9Rq5AI1QB FT9veCSC+iUapzSHw0KEG6P+z52ZDTY= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 38038A3C52; Mon, 21 Mar 2022 14:27:14 +0000 (UTC) Date: Mon, 21 Mar 2022 15:27:13 +0100 From: Michal Hocko To: David Rientjes Cc: David Hildenbrand , Zach O'Keefe , Alex Shi , 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 , Thomas Bogendoerfer , Yang Shi Subject: Re: [RFC PATCH 07/14] mm/khugepaged: add vm_flags_ignore to hugepage_vma_revalidate_pmd_count() 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 Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: E03628000C Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=tZHaNtpV; spf=pass (imf30.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspam-User: X-Stat-Signature: 8fcgu3rbbyzjsnautjtrzkx8u14donm3 X-HE-Tag: 1647872835-345713 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: [Dropped Richard Henderson from the CC list as the delivery fails for him] On Thu 10-03-22 10:54:03, David Rientjes wrote: > 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. yeah, this sounds like a bug to me. > > 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 do not think PR_SET_THP_DISABLE is any different from VM_NOHUGEPAGE. The process (owner) has opeted out from THPs for different reasons. Those might be unknown to whoever calls the madvise call (including itself). -- Michal Hocko SUSE Labs