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 9A809C433EF for ; Thu, 10 Mar 2022 18:40:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FF4D8D0002; Thu, 10 Mar 2022 13:40:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 186CE8D0001; Thu, 10 Mar 2022 13:40:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 04E488D0002; Thu, 10 Mar 2022 13:40:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id EB54F8D0001 for ; Thu, 10 Mar 2022 13:40:05 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C9ABF21214 for ; Thu, 10 Mar 2022 18:40:05 +0000 (UTC) X-FDA: 79229341170.10.600E27B Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by imf14.hostedemail.com (Postfix) with ESMTP id 446F9100019 for ; Thu, 10 Mar 2022 18:40:05 +0000 (UTC) Received: by mail-lf1-f54.google.com with SMTP id e6so4386690lfc.1 for ; Thu, 10 Mar 2022 10:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5iFqxoNvPFLPzvYC7D+fMqSUXefJrg5u65qtho5w/Xg=; b=p+2y+EcE7f9W2hgDEwo7mwkCUNvk1CJKNTj730taptIQhaz4W64sYtL2EbRppOdFMl KnQfj28+O8SVqjT20MGA0v2EVh0yG4DzUgW12O5fDoy85aP/+NOiyqwBN8BhN0lEDhw9 ijrJS1ruzzTOllorFg69h6o3ditXFAGsOUM6JCmDyGd8VNrRq9bthVuSER/M7HPUkdgv CozKYOoiGapsZP1OwP1Qb51vaL6Pg6BKmtiquXW2b+V0qjFPvlgzOVxSAiuKVX2kDnHn E2PsckDaeWZbQywWBVAtq0qJADNhjNeznX4+In4e7iFJRcuIvEk6wW3wYK0fSY9EmxTZ iZNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5iFqxoNvPFLPzvYC7D+fMqSUXefJrg5u65qtho5w/Xg=; b=wKHQ0lrNuckL6WlC61ryONDU7mNsqV6/3BTGemU6YNCjT0vtUaPD3Te/YvUTTux8pV 25g3ZUsgiwcxvK+V27rkXh27BB11QnxBGOfmLoSRNzGD4XNF40Eu0svlD8EAY1XVOdsk gbhRwlWPEKHkILRzE15V2lI7W3W/Wfm6V8KS601jang8BBPh628fg4zGkpg4Eb7E2GrX 3J2SKe7yv+O8HN8bOd90rkHe9wxrB5Tkz9lq6qPMz4KeszJsL8+W5pxDQImB6ZZVTy+O Q36AlOyaHZBN/5FDfxKJLuRxtQ8sAAB8eVcRPHJxpyXbjn/QZRiIa/QXACArscRvDrjD z/fA== X-Gm-Message-State: AOAM532cIaTRpKRU6T1sMJdzWtWZPvhKkgZDDGZFyYNKydyi19pJ6/Er HiW3ErOAu+7iSF2ELKnxRsipatiA/P04FfuWowMWZQ== X-Google-Smtp-Source: ABdhPJyQ95rM+tAphoo09sFGjzs5XTzjEmYmxNht05LacotkaBWZ+jy2P7xo+q2ZbWym2VlT98s8vP7BdMSxEv95n+E= X-Received: by 2002:a05:6512:2081:b0:448:59e4:7b48 with SMTP id t1-20020a056512208100b0044859e47b48mr3889749lfr.198.1646937603516; Thu, 10 Mar 2022 10:40:03 -0800 (PST) MIME-Version: 1.0 References: <20220308213417.1407042-1-zokeefe@google.com> <20220308213417.1407042-8-zokeefe@google.com> <30571216-5a6a-7a11-3b2c-77d914025f6d@redhat.com> In-Reply-To: <30571216-5a6a-7a11-3b2c-77d914025f6d@redhat.com> From: "Zach O'Keefe" Date: Thu, 10 Mar 2022 10:39:26 -0800 Message-ID: Subject: Re: [RFC PATCH 07/14] mm/khugepaged: add vm_flags_ignore to hugepage_vma_revalidate_pmd_count() To: David Hildenbrand Cc: Alex Shi , David Rientjes , 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 Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 446F9100019 X-Stat-Signature: 8cot3mcs95746gk41rqganfu83o1dx33 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=p+2y+EcE; spf=pass (imf14.hostedemail.com: domain of zokeefe@google.com designates 209.85.167.54 as permitted sender) smtp.mailfrom=zokeefe@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1646937605-145652 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, Mar 10, 2022 at 7:56 AM 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. > > > What about a prctl instead, to disable any khugepagd activity and just > let that process control it manually? > > -- > Thanks, > > David / dhildenb > Hey David - thanks for reviewing and commenting, and certainly thank you for finding this bug. This seems like good motivation for not ignoring VM_NOHUGEPAGE. arch/powerpc also uses this flag for its own purposes (though it's user-directed in that particular case). prctrl(2) sounds very reasonable to me - thanks for the suggestion! Thanks, Zach