Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752413AbdIRHDV (ORCPT ); Mon, 18 Sep 2017 03:03:21 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36082 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752326AbdIRHDT (ORCPT ); Mon, 18 Sep 2017 03:03:19 -0400 X-Google-Smtp-Source: ADKCNb5+VnxRx/coL9kZHuKDLAHmEsZ+YU06xEGi8XcGiPtuMrVuxMVRGlHY5m44RfyU1EPsSgzb/Q== Date: Mon, 18 Sep 2017 16:03:13 +0900 From: Sergey Senozhatsky To: "Luck, Tony" Cc: Helge Deller , Sergey Senozhatsky , "linux-kernel@vger.kernel.org" , Sergey Senozhatsky , Petr Mladek , Andrew Morton , "Yu, Fenghua" , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Subject: Re: [PATCH 00/14] Fix wrong %pF and %pS printk format specifier usages Message-ID: <20170918070313.GA1514@jagdpanzerIV.localdomain> References: <3908561D78D1C84285E8C5FCA982C28F6136C2ED@ORSMSX114.amr.corp.intel.com> <20170908061830.GA496@jagdpanzerIV.localdomain> <20170908172528.qc2vdtxzqh777k6o@intel.com> <67a0aad8-5412-60f8-6481-562d37995eb2@gmx.de> <20170914074044.GE599@jagdpanzerIV.localdomain> <20170914080302.GF599@jagdpanzerIV.localdomain> <404e94ca-36b3-8ea2-8ccc-e4a261b38416@gmx.de> <20170914092709.GI599@jagdpanzerIV.localdomain> <3908561D78D1C84285E8C5FCA982C28F613760F4@ORSMSX114.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F613760F4@ORSMSX114.amr.corp.intel.com> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2544 Lines: 93 On (09/14/17 16:01), Luck, Tony wrote: > > > let's hear from ia64 and ppc64 guys. > > If you write a patch, I can try it on some ia64 h/w. > > Please include some test cases (perhaps as a second patch that adds a few good/bad %pF and %pS > to some code (both in base kernel, and in a module). Hello, I sent out an RFC patch set. would the following test case work for you? kernel) echo 1 > /proc/sys/vm/drop_caches module) modprobe zram echo 100M > /sys/block/zram0/disksize --- drivers/block/zram/zram_drv.c | 15 +++++++++++++++ fs/drop_caches.c | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 2981c27d3aae..ac92aaeaced0 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1508,6 +1508,12 @@ static int zram_add(void) struct request_queue *queue; int ret, device_id; + printk("printk#13 %pF\n", (void *)_RET_IP_); + printk("printk#14 %pS\n", (void *)_RET_IP_); + + printk("printk#15 %pF\n", __builtin_return_address(0)); + printk("printk#16 %pS\n", __builtin_return_address(0)); + zram = kzalloc(sizeof(struct zram), GFP_KERNEL); if (!zram) return -ENOMEM; @@ -1730,6 +1736,15 @@ static int __init zram_init(void) { int ret; + printk("printk#7 %pF\n", zram_init); + printk("printk#8 %pS\n", zram_init); + + printk("printk#9 %pF\n", (void *)_RET_IP_); + printk("printk#10 %pS\n", (void *)_RET_IP_); + + printk("printk#11 %pF\n", __builtin_return_address(0)); + printk("printk#12 %pS\n", __builtin_return_address(0)); + ret = cpuhp_setup_state_multi(CPUHP_ZCOMP_PREPARE, "block/zram:prepare", zcomp_cpu_up_prepare, zcomp_cpu_dead); if (ret < 0) diff --git a/fs/drop_caches.c b/fs/drop_caches.c index d72d52b90433..3db4adcac78d 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c @@ -39,11 +39,22 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused) iput(toput_inode); } +#include + int drop_caches_sysctl_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { int ret; + printk("printk#1 %pF\n", schedule_timeout); + printk("printk#2 %pS\n", schedule_timeout); + + printk("printk#3 %pF\n", (void *)_RET_IP_); + printk("printk#4 %pS\n", (void *)_RET_IP_); + + printk("printk#5 %pF\n", __builtin_return_address(0)); + printk("printk#6 %pS\n", __builtin_return_address(0)); + ret = proc_dointvec_minmax(table, write, buffer, length, ppos); if (ret) return ret;