From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756063AbcIMNSI (ORCPT ); Tue, 13 Sep 2016 09:18:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36724 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751438AbcIMNSG (ORCPT ); Tue, 13 Sep 2016 09:18:06 -0400 Date: Tue, 13 Sep 2016 08:18:02 -0500 From: Josh Poimboeuf To: Byungchul Park Cc: peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, walken@google.com, boqun.feng@gmail.com, kirill@shutemov.name, linux-kernel@vger.kernel.org, linux-mm@kvack.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, npiggin@gmail.com Subject: Re: [PATCH v3 01/15] x86/dumpstack: Optimize save_stack_trace Message-ID: <20160913131802.oiwxgpmccn7uufef@treble> References: <1473759914-17003-1-git-send-email-byungchul.park@lge.com> <1473759914-17003-2-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1473759914-17003-2-git-send-email-byungchul.park@lge.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 13 Sep 2016 13:18:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 13, 2016 at 06:45:00PM +0900, Byungchul Park wrote: > Currently, x86 implementation of save_stack_trace() is walking all stack > region word by word regardless of what the trace->max_entries is. > However, it's unnecessary to walk after already fulfilling caller's > requirement, say, if trace->nr_entries >= trace->max_entries is true. > > I measured its overhead and printed its difference of sched_clock() with > my QEMU x86 machine. The latency was improved over 70% when > trace->max_entries = 5. This code will (probably) be obsoleted soon with my new unwinder. Also, my previous comment was ignored: Instead of adding a new callback, why not just check the ops->address() return value? It already returns an error if the array is full. I think that would be cleaner and would help prevent more callback sprawl. -- Josh