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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E0F9C43461 for ; Thu, 15 Apr 2021 23:12:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E2A3461029 for ; Thu, 15 Apr 2021 23:12:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2A3461029 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6C8E56B0070; Thu, 15 Apr 2021 19:12:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6794C6B0071; Thu, 15 Apr 2021 19:12:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F3456B0074; Thu, 15 Apr 2021 19:12:39 -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 2D8656B0070 for ; Thu, 15 Apr 2021 19:12:39 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E4BB11826B6D9 for ; Thu, 15 Apr 2021 23:12:38 +0000 (UTC) X-FDA: 78036152796.07.42FB644 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf21.hostedemail.com (Postfix) with ESMTP id 86BD0E000108 for ; Thu, 15 Apr 2021 23:12:36 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id t22so12631763ply.1 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=dUdquASW+E+GbTCJApeJNZWBihrzMHZvy5Z5hMK6Y1PwLTjRGVe0sATpNghCQCwhAR LcjUscAE8GbUVrVrXgBymCZRxv6id+pURcKRGsRkXo4f316iFjoIm723TvaV4YLwRwz+ wp9Eu9+aqoTcYumlPC6gciYUGi4zp+cjwEsnpP6mbdLtVdKTWsr6i2hQY9vyAs4adCdS 3YrX+HxroLJ05VfJ/o8c9wF+B6xgGsYf2USx2Ctz1FztxNlXV08FltrItncjY/furoW4 Xq014xhdgYx/ay0E89jKwCNA8ikWObIXy71W+A1OrHKVEhYzn4UVXjleTH01ZgxZevsI qcQw== X-Gm-Message-State: AOAM531euJPfsQbfJfz6PZ3k57hDfTP6TozeROru4abl5ibVvW55c4q8 QUMoivrBzz1If1eNgjnOcoW0Gg== X-Google-Smtp-Source: ABdhPJxtoW/lfV/Z4uQg/42K/o4Py3SAIqP7jABAruwS7PxREUqkSHGAEbZJMX/djPbOm2w9XfP5tw== 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 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 86BD0E000108 X-Stat-Signature: qdfdi4ee5ian5fzk61j66dh7du9k8s1r Received-SPF: none (axtens.net>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=mail-pl1-f182.google.com; client-ip=209.85.214.182 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618528356-407013 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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