From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754361AbcHSKNM (ORCPT ); Fri, 19 Aug 2016 06:13:12 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36284 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752581AbcHSKNJ (ORCPT ); Fri, 19 Aug 2016 06:13:09 -0400 From: Michal Hocko To: Andrew Morton Cc: Joe Perches , Jann Horn , , LKML Subject: [PATCH 0/2] fs, proc: optimize smaps output formatting Date: Fri, 19 Aug 2016 12:12:58 +0200 Message-Id: <1471601580-17999-1-git-send-email-mhocko@kernel.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1471519888-13829-1-git-send-email-mhocko@kernel.org> References: <1471519888-13829-1-git-send-email-mhocko@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, this is rebased on top of next-20160818. Joe has pointed out that meminfo is using a similar trick so I have extracted guts of what we have already and made it more generic to be usable for smaps as well (patch 1). The second patch then replaces seq_printf with seq_write and show_val_kb which should have smaller overhead and my measuring (in kvm) shows quite a nice improvements. I hope kvm is not playing tricks on me but I didn't get to test on a real HW. Michal Hocko (2): proc, meminfo: abstract show_val_kb proc, smaps: reduce printing overhead fs/proc/internal.h | 17 ++++++++++ fs/proc/meminfo.c | 93 ++++++++++++++++++++++++++---------------------------- fs/proc/task_mmu.c | 58 +++++++++++----------------------- 3 files changed, 81 insertions(+), 87 deletions(-)