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 8A23CC433EF for ; Fri, 15 Apr 2022 00:04:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 252F46B0071; Thu, 14 Apr 2022 20:04:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1DD5C6B0073; Thu, 14 Apr 2022 20:04:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02EEC6B0074; Thu, 14 Apr 2022 20:04:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id E552A6B0071 for ; Thu, 14 Apr 2022 20:04:50 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9D1291828AE43 for ; Fri, 15 Apr 2022 00:04:50 +0000 (UTC) X-FDA: 79357167540.30.1A8D382 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf25.hostedemail.com (Postfix) with ESMTP id 109FBA0009 for ; Fri, 15 Apr 2022 00:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649981089; h=from:from:reply-to:subject:subject: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=BFqWjUBWDldlnJ6klw6qKkZ+UbuuVaix4vVf90lVIYg=; b=VJV49pXISA5t/Q/m2E13H90my4ZYZ46cuCGd1DQ8wfdEQ1P0Y88Ud6PaYTYdORX0aSAQ4i k4jXqLEa6X6mEoA8mlykRnvO3swsRfDE2umPiShdFYU/DfQrgG7dNY6zyUranPrwDbjhm4 XHxmvwqwS1ANQXn0/UiW/ACffFhzC8w= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-512-b714WOKQOr6AH6ZJXA12Wg-1; Thu, 14 Apr 2022 20:04:48 -0400 X-MC-Unique: b714WOKQOr6AH6ZJXA12Wg-1 Received: by mail-il1-f199.google.com with SMTP id m11-20020a056e020deb00b002cbde7e7dcfso2688953ilj.2 for ; Thu, 14 Apr 2022 17:04:48 -0700 (PDT) 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=BFqWjUBWDldlnJ6klw6qKkZ+UbuuVaix4vVf90lVIYg=; b=x5Q0VLHcpdA+lPHYDeLY14EfsZN97xGzMkRJiMMj6hO0psKXg+/2p7FQkJfjjnzOC/ 3cytuNTbRPsUO+RVQDWCSqx25FkQZQ09ubdwfrsXBKYhJO4tNZI6R8S8VJvkQW/aQM2s 9tXap6Bfn3c4S+sDTNunjFnQPF8n5jX0LrFWcpEMX7OrZjwfAdUatAuWQ9XYxzDUd3+p tnUdQ7kQu+vJa/CbBzmVF6989IGYOVWUq07mCuW6dUhWhNVb4kGUn7KiJ0Nl2F1lqarn VdPJf9d1o5GfdH5L9HunlDgh0mT+LtlgW2obQcdDabM9M3iLPgSWdndmHVuSuHdBtTNJ I1wg== X-Gm-Message-State: AOAM533JX4mijnauik4nKeDbF+83aqlmx9vP5hY0G/3IPBxjjobMYIiK Uhxgqw71SP7053RAF7bACznFlER4Zcu/uBRKNCXYJdVIk22qyqTtStOV7E+dZtfHV0bVtcuhRC1 CCrXrLd8+WQA= X-Received: by 2002:a05:6e02:12e9:b0:2c9:f576:8951 with SMTP id l9-20020a056e0212e900b002c9f5768951mr2152427iln.204.1649981087670; Thu, 14 Apr 2022 17:04:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVy6V4CzHmvLrXdmUw/A6NyBV3zv4bp8qu8NwYMSqmGqJ6Gq2LcrXXV/CrzBnAff3zJgd0Rw== X-Received: by 2002:a05:6e02:12e9:b0:2c9:f576:8951 with SMTP id l9-20020a056e0212e900b002c9f5768951mr2152395iln.204.1649981087458; Thu, 14 Apr 2022 17:04:47 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id z5-20020a92cec5000000b002cbe5a870dfsm1666122ilq.36.2022.04.14.17.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 17:04:47 -0700 (PDT) Date: Thu, 14 Apr 2022 20:04:44 -0400 From: Peter Xu To: Zach O'Keefe Cc: Alex Shi , David Hildenbrand , David Rientjes , Matthew Wilcox , Michal Hocko , Pasha Tatashin , SeongJae Park , Song Liu , Vlastimil Babka , Yang Shi , 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" , Matt Turner , Max Filippov , Miaohe Lin , Minchan Kim , Patrick Xia , Pavel Begunkov , Thomas Bogendoerfer Subject: Re: [PATCH v2 00/12] mm: userspace hugepage collapse Message-ID: References: <20220414180612.3844426-1-zokeefe@google.com> MIME-Version: 1.0 In-Reply-To: <20220414180612.3844426-1-zokeefe@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VJV49pXI; spf=none (imf25.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: 46zz4cxficxyoij6nr3yzo96yf3h14ms X-Rspamd-Queue-Id: 109FBA0009 X-Rspamd-Server: rspam04 X-Rspam-User: X-HE-Tag: 1649981089-497994 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: Hi, Zach, On Thu, Apr 14, 2022 at 11:06:00AM -0700, Zach O'Keefe wrote: > process_madvise(2) > > Performs a synchronous collapse of the native pages > mapped by the list of iovecs into transparent hugepages. > > Allocation semantics are the same as khugepaged, and depend on > (1) the active sysfs settings > /sys/kernel/mm/transparent_hugepage/enabled and > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag, and (2) > the VMA flags of the memory range being collapsed. > > Collapse eligibility criteria differs from khugepaged in that > the sysfs files > /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_[none|swap|shared] > are ignored. The userspace khugepaged idea definitely makes sense to me, though I'm curious how the line is drown on the different behaviors here by explicitly ignoring the max_ptes_* entries. Let's assume the initiative is to duplicate a more data-aware khugepaged in the userspace, then IMHO it makes more sense to start with all the policies that applies to khugepaged already, including max_pte_*. I can understand the willingness to provide even stronger semantics here than khugepaged since the userspace could have very clear knowledge of how to provision the memories (better than a kernel scanner). It's just that IMHO it could be slightly confusing if the new interface only partially apply the khugepaged rules. No strong opinion here. It could already been a trade-off after the discussion from the RFC with Michal which I read.. Just curious about how you made that design decision so feel free to read it as a pure question. Thanks, -- Peter Xu