Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1232346pxb; Thu, 15 Apr 2021 18:14:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysye8WqdI2kZW1T9FKWo/PPLGk1F4y60L13uR30mRxaRqNI4FdHcly9mlWmdgrocnNDy4H X-Received: by 2002:a17:902:8c92:b029:e8:fa73:ad22 with SMTP id t18-20020a1709028c92b02900e8fa73ad22mr6675730plo.66.1618535665967; Thu, 15 Apr 2021 18:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618535665; cv=none; d=google.com; s=arc-20160816; b=HjdJyiNGa1D7xFiiJm72GNaOyGAzbSz8TkCwqF0D5FKkKGKTQzims8uQHv6QtCrJUS AO7Poud2wveHtp8cWndB19lXwEaTWDiy+fzEu9ZV5Ju3NpDpu6eBfJTm6qCzQ5iHla99 p9kdTSG4ef4vOGpNgS/R4k9gOnPbQjQCR7yNF2Znt2xOkrijJnAT+f51m0aQo7j6uKGZ SLTA/Hih9xt0Wwpjw4XVHy9W1nBhrR4t4T098wiB5KPuTOp6MZNjwnfbMWbTO0mKQDos luBZOmGi0q4X6+R8/uZ2bJaWpl4KafQkCMpZb5oMGdn4HhJf8mvXvzZP0+/iikTao0kl xEvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=quZmVxdkfveDUtpLM1NU/LuQrdZNONtDpXYzxh0MMQU=; b=enWdlI4h2r612FHX1mZZWcX+uCR7lWabU667g5UTKOveF5mvPOrzTQVgBYGy83lOsH BN3NlrwpDY8ymNMKE67LcID0zPBg4h6RQ9LJLhTYedjsR/147ZtXjBsZoo47sZB7CkJW zve4Gfzftw4eHiAx4/YwGW8V2t6BxnZ5F7Hou9ha8KbSTjIsKxYb00fXCIf9bTyMaFcS tKQX3XofThXn3MbtpLrCq+EaghoEJEMVufWJaWviNYG29bI6PLc5a1rPXzOKdLiHgBa+ iyrqamWkGidlYS9ZT9LEFvfvG0/49CGdItuJB5OBLt2gfanG+8DQ1q4zm+g8/tv5Y+cD vMXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=dlBNCIJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g18si4978870plg.158.2021.04.15.18.13.44; Thu, 15 Apr 2021 18:14:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@axtens.net header.s=google header.b=dlBNCIJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236677AbhDOXNE (ORCPT + 99 others); Thu, 15 Apr 2021 19:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234914AbhDOXNC (ORCPT ); Thu, 15 Apr 2021 19:13:02 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15261C06175F for ; Thu, 15 Apr 2021 16:12:38 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id x21-20020a17090a5315b029012c4a622e4aso13557418pjh.2 for ; Thu, 15 Apr 2021 16:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=quZmVxdkfveDUtpLM1NU/LuQrdZNONtDpXYzxh0MMQU=; b=dlBNCIJGr0qL38amaMZRkug9NjLuSZKepOmlGO/a/0dku+GQVYqb2GS0jPTD9w2gLe mxyKCuERedST3RGnVbk4l07BD+E5BOSCp/2NFPvySo56I89CsE7aDSCbVRn53Jv8Ql5N hSp7xLsHsW85pUai/ansn/rQu7ZvTTszyfp0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=quZmVxdkfveDUtpLM1NU/LuQrdZNONtDpXYzxh0MMQU=; b=KcjpWS96m/zFt5ptOx9gNxteG4PTzEpnSuTCofQZI4joOLncDpha3iIP8V0NDcpry3 WLqnyNDLRxAv/9Wg+HOoqAH6KGmHm2lBokpVmFMLvXmZmClPpV1LrACbex2aNYRlbTn1 NrZ0tAfp6ERY3MkZWeeK9z8/zV8uu1q0Hb2eHnw56rwvQh0qxGYWgJGkRWnoqHnABHz9 Y1ULbzrrhvFaXjMnpzPzXMWjtbTdW3FWPOialbq/dl9qJyfQhvYfNjqhXKAIDkf9yUJU NPIsYvxHq4ERKFuYgziTUXew0jiE4O68eOz0YiHtmzJOs9uWkF2Asdp5hTXXCxVonaqr 5H0w== X-Gm-Message-State: AOAM531xuJf2VgsBkYqE9eJHKV4XUGGh8d+/tAL/2Shw71S5ZuiylVGY c8RRhdE7nSGZh90gZumnnZVUAQ== X-Received: by 2002:a17:902:59d4:b029:ea:bbc5:c775 with SMTP id d20-20020a17090259d4b02900eabbc5c775mr6469026plj.11.1618528357637; Thu, 15 Apr 2021 16:12:37 -0700 (PDT) Received: from localhost (2001-44b8-111e-5c00-3f8b-a64e-9a27-b872.static.ipv6.internode.on.net. [2001:44b8:111e:5c00:3f8b:a64e:9a27:b872]) by smtp.gmail.com with ESMTPSA id x11sm3055779pfr.7.2021.04.15.16.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 16:12:37 -0700 (PDT) From: Daniel Axtens To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Steven Price , akpm@linux-foundation.org Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v1 3/5] mm: ptdump: Provide page size to notepage() In-Reply-To: <1ef6b954fb7b0f4dfc78820f1e612d2166c13227.1618506910.git.christophe.leroy@csgroup.eu> References: <1ef6b954fb7b0f4dfc78820f1e612d2166c13227.1618506910.git.christophe.leroy@csgroup.eu> Date: Fri, 16 Apr 2021 09:12:34 +1000 Message-ID: <8735vr16sd.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christophe, > static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level, > - u64 val) > + u64 val, unsigned long page_size) Compilers can warn about unused parameters at -Wextra level. However, reading scripts/Makefile.extrawarn it looks like the warning is explicitly _disabled_ in the kernel at W=1 and not reenabled at W=2 or W=3. So I guess this is fine... > @@ -126,7 +126,7 @@ static int ptdump_hole(unsigned long addr, unsigned long next, > { > struct ptdump_state *st = walk->private; > > - st->note_page(st, addr, depth, 0); > + st->note_page(st, addr, depth, 0, 0); I know it doesn't matter at this point, but I'm not really thrilled by the idea of passing 0 as the size here. Doesn't the hole have a known page size? > > return 0; > } > @@ -153,5 +153,5 @@ void ptdump_walk_pgd(struct ptdump_state *st, struct mm_struct *mm, pgd_t *pgd) > mmap_read_unlock(mm); > > /* Flush out the last page */ > - st->note_page(st, 0, -1, 0); > + st->note_page(st, 0, -1, 0, 0); I'm more OK with the idea of passing 0 as the size when the depth is -1 (don't know): if we don't know the depth we conceptually can't know the page size. Regards, Daniel