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 5A054C433EF for ; Tue, 4 Jan 2022 23:04:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D26726B0071; Tue, 4 Jan 2022 18:04:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CAE8B6B0072; Tue, 4 Jan 2022 18:04:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B50586B0073; Tue, 4 Jan 2022 18:04:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id A4ED46B0071 for ; Tue, 4 Jan 2022 18:04:45 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6DC5589B51 for ; Tue, 4 Jan 2022 23:04:45 +0000 (UTC) X-FDA: 78994136130.11.F07CE70 Received: from mail-ua1-f47.google.com (mail-ua1-f47.google.com [209.85.222.47]) by imf22.hostedemail.com (Postfix) with ESMTP id 30090C000F for ; Tue, 4 Jan 2022 23:04:43 +0000 (UTC) Received: by mail-ua1-f47.google.com with SMTP id c36so40365513uae.13 for ; Tue, 04 Jan 2022 15:04:44 -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=LGTDOKUFi7zO+d79pWO817pqCCSEiZUvdJ5m+8rvxCA=; b=Vq2UWrZRZ/V3IkL5xQPw4sK457GrJq/WGgnD994N8UpM5fE4ZpVWKkQjEJSUlRCC+S N80GiReieK9NC9xQVyvz9BhxYpwc7LWf6W4aM36q8k0Q69cY4+L2TfuN/oxwngrztnXF grm2OJ2nWYPzJUuXJoi/p4GKhsZup4A6WaVvS/mI2TD1KIyXvGEZgG33WSiJ6ccRLS1r jFxOohSEa8Jgp0MojMyyxYnPe5RJvAsOP5jXHv6Qqsrb6ENA2zOEmpT6XzjnESBDuUGP kDVZmzUh6zyRshn0uZqGSzMas96FCWFCWJbaEtXUxGcZ2vshAc44NreDhAWTpkUIfqvl c2LQ== 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=LGTDOKUFi7zO+d79pWO817pqCCSEiZUvdJ5m+8rvxCA=; b=ROs7ClObMX/VC9jRhDi7rbLKjq3CFJcVTuENuHHkhXoTx8y9L1EtzI9S85xG/zETG4 krrsyEIvbzW0YuVsIU6oaMeAt1sCc6MnApFN+pv6qQcke3RA35iDHU4UwSGl5Z9eoDeh BqIKNCYMrRrAF2g12x7g7NEfq5341QxQBzsFyJkjjB2nxJSGnlQj0kPyN3zYBbpfYyc/ reaf24JNI7Sybsx2e/pufwxpGbvGp0BO/xDHeR6acvio8GLfyfl40muQPMTe4hzguCXN dCABp/CMDRsSFCidvEXdIDD5UWWX0hqqqvv1hp0p5EeDto4rQruwOZgmiwzzOs6cMHc5 gRHQ== X-Gm-Message-State: AOAM533Qrj6kGuutUCkxXjrX9PIwX2YFhLrNCrFB9vc13x1nboskJfNY 3nCZdgBJaS+UfLZm4TRyiLMVkqpW8jM0+ysLm4VH1A== X-Google-Smtp-Source: ABdhPJzrzdQ9oZ8c9KxNThr7KVaZnd8IRIGK4zN+HrR/xQOECiyYuhQgixfNU7D+urgXsf2w6BRuPu+/B7sopDGcZBs= X-Received: by 2002:ab0:6201:: with SMTP id m1mr13499007uao.25.1641337483580; Tue, 04 Jan 2022 15:04:43 -0800 (PST) MIME-Version: 1.0 References: <20211123000102.4052105-1-almasrymina@google.com> In-Reply-To: From: Mina Almasry Date: Tue, 4 Jan 2022 15:04:31 -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-Queue-Id: 30090C000F X-Stat-Signature: wyibzboaqy6e8oy3nfqt159z9n6p18dm Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Vq2UWrZR; spf=pass (imf22.hostedemail.com: domain of almasrymina@google.com designates 209.85.222.47 as permitted sender) smtp.mailfrom=almasrymina@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam10 X-HE-Tag: 1641337483-244766 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 Mon, Dec 13, 2021 at 4:22 PM Mina Almasry wrote: > > 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. Friendly ping on this. It has been reviewed by a few folks and after Matthew had questions about the use case which I've answered in the email above. Matthew, are you opposed to this patch?