From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754706AbcHVHlP (ORCPT ); Mon, 22 Aug 2016 03:41:15 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34886 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752564AbcHVHkz (ORCPT ); Mon, 22 Aug 2016 03:40:55 -0400 Date: Mon, 22 Aug 2016 09:40:52 +0200 From: Michal Hocko To: Minchan Kim Cc: Sonny Rao , Jann Horn , Robert Foss , corbet@lwn.net, Andrew Morton , Vlastimil Babka , Konstantin Khlebnikov , Hugh Dickins , Naoya Horiguchi , John Stultz , ross.zwisler@linux.intel.com, jmarchan@redhat.com, Johannes Weiner , Kees Cook , Al Viro , Cyrill Gorcunov , Robin Humble , David Rientjes , eric.engestrom@imgtec.com, Janis Danisevskis , calvinowens@fb.com, Alexey Dobriyan , "Kirill A. Shutemov" , ldufour@linux.vnet.ibm.com, linux-doc@vger.kernel.org, "linux-kernel@vger.kernel.org" , Ben Zhang , Bryan Freed , Filipe Brandenburger , Mateusz Guzik Subject: Re: [PACTH v2 0/3] Implement /proc//totmaps Message-ID: <20160822074052.GC13596@dhcp22.suse.cz> References: <20160817082200.GA10547@dhcp22.suse.cz> <20160817093125.GA27782@pc.thejh.net> <20160817130320.GC20703@dhcp22.suse.cz> <20160818074433.GC30162@dhcp22.suse.cz> <20160818180104.GS30162@dhcp22.suse.cz> <20160819022634.GA14206@bbox> <20160819080532.GC32619@dhcp22.suse.cz> <20160822000745.GA21441@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160822000745.GA21441@bbox> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 22-08-16 09:07:45, Minchan Kim wrote: [...] > #!/bin/sh > ./smap_test & > pid=$! > > for i in $(seq 25) > do > awk '/^Rss/{rss+=$2} /^Pss/{pss+=$2} END {}' \ > /proc/$pid/smaps > done > kill $pid > > root@bbox:/home/barrios/test/smap# time ./s.sh > pid:21973 > > real 0m17.812s > user 0m12.612s > sys 0m5.187s retested on the bare metal (x86_64 - 2CPUs) Command being timed: "sh s.sh" User time (seconds): 0.00 System time (seconds): 18.08 Percent of CPU this job got: 98% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:18.29 multiple runs are quite consistent in those numbers. I am running with $ awk --version GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0) > > like a problem we are not able to address. And I would even argue that > > we want to address it in a generic way as much as possible. > > Sure. What solution do you think as generic way? either optimize seq_printf or replace it with something faster. -- Michal Hocko SUSE Labs