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 AEC29C433EF for ; Tue, 14 Dec 2021 00:22:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F249F6B0071; Mon, 13 Dec 2021 19:22:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ED4526B0072; Mon, 13 Dec 2021 19:22:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D74E06B0074; Mon, 13 Dec 2021 19:22:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id C35A36B0071 for ; Mon, 13 Dec 2021 19:22:41 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 82D3288CFA for ; Tue, 14 Dec 2021 00:22:31 +0000 (UTC) X-FDA: 78914498502.18.F0AC09A Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by imf31.hostedemail.com (Postfix) with ESMTP id 678F020010 for ; Tue, 14 Dec 2021 00:22:26 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id z18so21174836iof.5 for ; Mon, 13 Dec 2021 16:22:30 -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=xdDuB1YG6XTXDhWwkGkmln0E+/N5BEU+BrEQQgdpPmY=; b=gwhbkJpHH5rTNp0Z6uxU5d66XAXmNYxGmy0drFgtfDh+geMk3+7EMaZf7sCjgI/5dp WUIYDPOrkylCGZ0bu9Bmvw9tzrpkcO2HpVPhI6E+WKqfjWQhw05snOM3fHY6lwHZrPoM oVsLRQuiea1Cw8ul/DTzFiVBFASI9arLmfmM5b28xIih0qSGDPqEHxI6tViuxe7/Fk17 Hd++hOSc1UsKmzQsFdOjfiu458/cgzOqhBOURC2RSjG1my9MG077fkZAmEVWI7bpDeMZ Pwt8rSyuBUNWIAc0M4jGSRXGHzos9DXq+C1Vni+0z8ZOGAnnzrhS8c+Wtv001oejjzJX BSzg== 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=xdDuB1YG6XTXDhWwkGkmln0E+/N5BEU+BrEQQgdpPmY=; b=zNlNxn7rags4+Ku2cYfN4wKFlOufw8JAuGqQQeu620/VxyZLnx7XQTk/l9TkJbGKip Sdv6LkL2Om8hY6jiIz9PWi9+uOBZAi5v6Y2/wq82w/ny5SZRKm9hp0uH3JludRdScG9Q 9mUw6POGD0KK9uv2yKye2rl7h0o0sjzjBwXp6QRI0frfMOWoPPTwXXqUR0kf8Nw9zJW4 LGzDaKY7PG7RN9R7iBcYvrt6GoYyEMRDomuY6ztvWKmKPiFisKQdauJLHu5ZQENImBQI 4TCf4wlqaZLL3L9T8cPVXIUTVxYBrTJ9zD2YxAZMhgBMM/SB5tOch9DE8yiu2mnfLQqa X4Ww== X-Gm-Message-State: AOAM530gGZZiQ1seqFiKCbay9SrNBwMLNckGANGwZS/0ctk4OyQCDptH U7E99A1zLW93RIIDp+GR/wJnnK8h4DkJfi48+NNgaQ== X-Google-Smtp-Source: ABdhPJyCHKaf9UKVoATEck3LTMSSftVTZ/0PQGYg+50WAy0eM15osVpyM19KBCZdRXcUqPPpyYL26Oca5akvBsAqT/w= X-Received: by 2002:a6b:ea0a:: with SMTP id m10mr1382455ioc.91.1639441350311; Mon, 13 Dec 2021 16:22:30 -0800 (PST) MIME-Version: 1.0 References: <20211123000102.4052105-1-almasrymina@google.com> In-Reply-To: From: Mina Almasry Date: Mon, 13 Dec 2021 16:22:19 -0800 Message-ID: Subject: Re: [PATCH v7] mm: Add PM_THP_MAPPED to /proc/pid/pagemap To: Matthew Wilcox Cc: Jonathan Corbet , David Hildenbrand , "Paul E . McKenney" , Yu Zhao , Andrew Morton , Peter Xu , Ivan Teterevkov , Florian Schmidt , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 678F020010 X-Stat-Signature: u8cgcs3nqke7rw8bebqc7cg479czimfw Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=gwhbkJpH; spf=pass (imf31.hostedemail.com: domain of almasrymina@google.com designates 209.85.166.41 as permitted sender) smtp.mailfrom=almasrymina@google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1639441346-757964 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 Sat, Nov 27, 2021 at 8:10 PM Matthew Wilcox wrote: > > On Mon, Nov 22, 2021 at 04:01:02PM -0800, Mina Almasry wrote: > > Add PM_THP_MAPPED MAPPING to allow userspace to detect whether a given virt > > address is currently mapped by a transparent huge page or not. Example > > use case is a process requesting THPs from the kernel (via a huge tmpfs > > mount for example), for a performance critical region of memory. The > > userspace may want to query whether the kernel is actually backing this > > memory by hugepages or not. > > But what is userspace going to _do_ differently if the kernel hasn't > backed the memory with huge pages? Sorry for the late reply here. My plan is to expose this information as metrics right now and: 1. Understand the kind of hugepage backing we're actually getting if any. 2. If there are drops in hugepage backing we can investigate the cause, whether it's due to normal memory fragmentation or some bug/issue. 3. Schedule machines for reboots to defragment the memory if the hugepage backing is too low. 4. Possibly motivate future work to improve hugepage backing if our numbers are too low.