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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97DE8C433F5 for ; Tue, 16 Nov 2021 01:59:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3E1ED61A89 for ; Tue, 16 Nov 2021 01:59:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3E1ED61A89 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 7E3ED6B00B1; Mon, 15 Nov 2021 20:59:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 793796B00B2; Mon, 15 Nov 2021 20:59:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 683516B00B3; Mon, 15 Nov 2021 20:59:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0154.hostedemail.com [216.40.44.154]) by kanga.kvack.org (Postfix) with ESMTP id 56C8B6B00B1 for ; Mon, 15 Nov 2021 20:59:21 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0C3E98249980 for ; Tue, 16 Nov 2021 01:59:21 +0000 (UTC) X-FDA: 78813136122.29.BB22F54 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf03.hostedemail.com (Postfix) with ESMTP id B01D53001A07 for ; Tue, 16 Nov 2021 01:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637027959; 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=PcHmUdloBDYBnO1Vfa9QPmbf+FFF2gIjnC+Yb39rMoE=; b=NR7IrsoUp+JhUxKhS47X95j2zq045L71EoOFHsA8f21AbGJItUfHuGp//f+7EroCzH6C0G iMgA5ooLAntq7/9B+4TmHEj0hVEwjLpoWz6mW8Oaqkh6wSOW7QUqdzjHjVzcApxrROulUE 9ReHRb/27OORfqYdtVtkLu9e6lidozg= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-591-7Q9eMCPQOmubxAma6sOVoA-1; Mon, 15 Nov 2021 20:59:18 -0500 X-MC-Unique: 7Q9eMCPQOmubxAma6sOVoA-1 Received: by mail-pg1-f197.google.com with SMTP id t1-20020a6564c1000000b002e7f31cf59fso1580482pgv.14 for ; Mon, 15 Nov 2021 17:59:18 -0800 (PST) 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=PcHmUdloBDYBnO1Vfa9QPmbf+FFF2gIjnC+Yb39rMoE=; b=HLGB42I+DSfmnjYCB+r6cUdmuJ7POI5S4yd4ZBHtSne2483aBYRLj7OcWYVW7vpGDQ dpFIGlJu8zVNEdUQGfozswwCPQRDhX6F6k52J8DgEaAo6XGBiOnRGwkKc38yUOOaSGE5 /pbyby4ShbXOt9R+YOfOstkoCy8wYoxG8/tkypWbqiBgSUBaVDGY+INWZGHGURJQF7w/ 3E4+JKmvVL3xHaaOUeIFC7F1kWM4IiFXcbvz6WH7ZnoecO9rZuuSBLe5kdKgyMK1vjJk WO8EcUQSd6AdDCHziT2HhmTzdOn6uApGH27gIFi8bWwsZVL9H4srWlMyvTWDOT25xFN2 6tjQ== X-Gm-Message-State: AOAM532k7OXpxbkgzFKo4dw4Unqc76aSdTn2KWL0Ctb+dDNNWV8/SKRc 3u776aeyTlsEKj59hDoA+hf6bgtzHWU/Eifecib2hz7lYuXz5D/4Yi4mEdEQC+BLMaaxFqXV2LN wZmvZBMZ2lZo= X-Received: by 2002:a17:902:6b47:b0:142:82e1:6cf5 with SMTP id g7-20020a1709026b4700b0014282e16cf5mr40927411plt.28.1637027957592; Mon, 15 Nov 2021 17:59:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKM0irZy6MEENYIUeb4VgibHSWGI1JDBHGPOY88s77OFBFd8XKwQnOpry9mxgunT5NjmEyBw== X-Received: by 2002:a17:902:6b47:b0:142:82e1:6cf5 with SMTP id g7-20020a1709026b4700b0014282e16cf5mr40927373plt.28.1637027957285; Mon, 15 Nov 2021 17:59:17 -0800 (PST) Received: from xz-m1.local ([191.101.132.59]) by smtp.gmail.com with ESMTPSA id lx12sm546013pjb.5.2021.11.15.17.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 17:59:16 -0800 (PST) Date: Tue, 16 Nov 2021 09:59:10 +0800 From: Peter Xu To: Mina Almasry Cc: David Hildenbrand , Matthew Wilcox , "Paul E . McKenney" , Yu Zhao , Jonathan Corbet , Andrew Morton , Ivan Teterevkov , Florian Schmidt , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v4] mm: Add PM_HUGE_THP_MAPPING to /proc/pid/pagemap Message-ID: References: <20211107235754.1395488-1-almasrymina@google.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Stat-Signature: y535ysn8i151zbhtue78qjifgjiehhek Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NR7IrsoU; spf=none (imf03.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B01D53001A07 X-HE-Tag: 1637027950-641804 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, Nov 15, 2021 at 02:50:26PM -0800, Mina Almasry wrote: > PM_THP_MAPPED sounds good to me. > > TBH I think I still prefer this approach because it's a very simple 2 > line patch which addresses the concrete use case I have well. I'm not > too familiar with the smaps code to be honest but I think adding a > range-based smaps API will be a sizeable patch to add a syscall, > handle a stable interface, and handle cases where the memory range > doesn't match a VMA boundary. I'm not sure the performance benefit > would justify this patch and I'm not sure the extra info from smaps > would be widely useful. However if you insist and folks believe this > is the better approach I can prototype a range-based smaps and test > its performance to see if it works for us as well, just let me know > what kind of API you're envisioning. Yeah indeed I haven't yet thought enough on such a new interface, it's just that I think it'll be something that solves a broader range of requests including the thp-aware issue, so I raised it up. That shouldn't require a lot code change either afaiu, as smap_gather_stats() already takes a "start" and I think what's missing is another end where we just pass in 0 when we want the default vma->vm_end as the end of range. I don't have a solid clue on other use case to ask for that more generic interface, so please feel free to move on with it. If you'll need a repost to address the comment from Andrew on removing the debugging lines, please also consider using the shorter PM_THP_MAPPED then it looks good to me too. Thanks! -- Peter Xu