From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751677AbcHGDQa (ORCPT ); Sat, 6 Aug 2016 23:16:30 -0400 Received: from mga09.intel.com ([134.134.136.24]:24260 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105AbcHGDQ3 (ORCPT ); Sat, 6 Aug 2016 23:16:29 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,481,1464678000"; d="scan'208";a="1009790455" From: Andi Kleen To: Alexey Dobriyan Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] proc: faster /proc/*/status References: <20160806125608.GB1187@p183.telecom.by> Date: Sat, 06 Aug 2016 20:16:27 -0700 In-Reply-To: <20160806125608.GB1187@p183.telecom.by> (Alexey Dobriyan's message of "Sat, 6 Aug 2016 15:56:11 +0300") Message-ID: <87ziop46b8.fsf@tassilo.jf.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexey Dobriyan writes: > - > + seq_printf(m, "State:\t%s", get_task_state(p)); > + > + seq_puts(m, "\nTgid:\t"); The only different should be the format string. Scanning the format string really shouldn't be that expensive?!? It would be better if you could find out why that is slow and optimize it. Then you would benefit every seq_printf user, not just this special case. Perhaps it could benefit from some of the bit masking tricks to scan the string with wider tests than a word. -Andi -- ak@linux.intel.com -- Speaking for myself only