From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ve1eur01on0091.outbound.protection.outlook.com ([104.47.1.91]:26240 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750761AbeBJHuS (ORCPT ); Sat, 10 Feb 2018 02:50:18 -0500 Date: Fri, 9 Feb 2018 23:50:01 -0800 From: Andrei Vagin To: Alexey Dobriyan Cc: Andrei Vagin , linux-fsdevel@vger.kernel.org, Andrew Morton , KAMEZAWA Hiroyuki Subject: Re: [PATCH v2] procfs: add seq_put_hex_ll to speed up /proc/pid/maps Message-ID: <20180210075000.GA386@outlook.office365.com> References: <20180112153304.f4a7dfbae2942e3fdd93eab9@linux-foundation.org> <20180117082050.25406-1-avagin@openvz.org> <20180209134847.GA6916@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20180209134847.GA6916@avx2> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Feb 09, 2018 at 04:48:47PM +0300, Alexey Dobriyan wrote: > On Wed, Jan 17, 2018 at 12:20:50AM -0800, Andrei Vagin wrote: > > + * seq_put_hex_ll(m, "", v, 8) is equal to seq_printf(m, "0x08llx", v) > > No, it is not. Scratch "0x". will fix > > > +void seq_put_hex_ll(struct seq_file *m, const char *delimiter, > > + unsigned long long v, int width) > > I understand that "unsigned long long" mimics decimal counterpart, > but in thie case everything is "unsigned long" including ->vm_pgoff. I've checked that the performance is the same for "unsigned long long" and "unsigned long". Do we have other reasons to use "unsigned long" rather than "unsigned long long"? > > Also, width should be unsigned for the common case of %08lx > (and "len" too) will fix Thank you for the review. > > > +{ > > + int i, len; > > +