From patchwork Thu Apr 25 09:44:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 10916563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16860161F for ; Thu, 25 Apr 2019 09:59:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07BFA28C4E for ; Thu, 25 Apr 2019 09:59:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE67328C53; Thu, 25 Apr 2019 09:59:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D08A28C4E for ; Thu, 25 Apr 2019 09:59:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E5066B0266; Thu, 25 Apr 2019 05:59:24 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1BE256B026B; Thu, 25 Apr 2019 05:59:24 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE9896B0269; Thu, 25 Apr 2019 05:59:23 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by kanga.kvack.org (Postfix) with ESMTP id 9860E6B0010 for ; Thu, 25 Apr 2019 05:59:23 -0400 (EDT) Received: by mail-wr1-f72.google.com with SMTP id r7so10963537wrc.14 for ; Thu, 25 Apr 2019 02:59:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:message-id :user-agent:date:from:to:cc:subject:references:mime-version; bh=ndPMY5lfafu/EZtXmPJOgPVCY5qMZpY8tacLKTDS9zk=; b=R1uaiaJJjZdtbFwLDGfkjKtalV5J6ECJ5shb7PTa+c569UwrCMtJUhwIp4EN0ESBS+ ihEaUsuvrlnFFpoUeX+u+DtGMWAlNpeY8t/igPd4MYP0xelrqFt+UWVBouZg7I5y0cpZ lKeZGHTuBfgb6pzrICSJH6KBZcPY/Dw/2Imx/sMXRl2h4rC49/zzX6Thkt0mqjEXPHt9 er11ocTSgbGnnS9hLAXCR9C6BMO2ADhw4HTVjFIJLKyUujRwj5nO1qPnUCQspKf17oi0 K+NzOLMDRL8UNWejj9fkNPdmB2bITriRrfTHrQpWOhUoCCkyztgAYgqNcVHbCcG3hsRb hvIw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=tglx@linutronix.de X-Gm-Message-State: APjAAAWSl6IHwr2izuDMaEnAy4kDigxH94GFd8omoiBex+mGegAbcyGf nNdZaHlI9LGwvYfvt/mn0x6508ErBVA9IcV8rXOYUT/piU6Q75FvUAOnewS489M1paxVXcU8rzn 0c+dbD14rHFPJUuY9Y56V2X/7l3oAKe0bEH/EDCttsWU01eZI6mRleqK1DLNz2C8z+Q== X-Received: by 2002:adf:e684:: with SMTP id r4mr11172645wrm.169.1556186363073; Thu, 25 Apr 2019 02:59:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyFzmcjgSFFs7ziXWDgu7DRnYCO+nyHBqWVwgoEiWsCHiUhJxtilhtgw2NNQr+BhYqRpKu X-Received: by 2002:adf:e684:: with SMTP id r4mr11172574wrm.169.1556186361664; Thu, 25 Apr 2019 02:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556186361; cv=none; d=google.com; s=arc-20160816; b=pRR823lUtQGKKCjJ6sp4vthrs1GIoDqWZMwNx3F6CIRpcAQdrAKd+2Crt2N2awLQ7E bdrANlcmTjefiDTKALRX6auNAoHpHWS8QauDuWo9WaYkPyVobFzNAGR++SnNydXeSvfo 2VTXZ3mDv6YWVyOT9j9bDq2XzogdbBkwXvZkj5x4FFWWJvyRkUBJ3Xi86pOpHnT2Ml2i B/XoclufjnJz1ZS2HofJoj34GbPrxcLELIw3UtmArPCxYAzXjYE8IEBSJN5KR4uJpcfH hk4PiD3mVHPOTLc0MYmG91vAqH7/rgG+Mr9812Lfa57gssj1ehDkI/cphfFTbUSZqm2P RCHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:subject:cc:to:from:date:user-agent :message-id; bh=ndPMY5lfafu/EZtXmPJOgPVCY5qMZpY8tacLKTDS9zk=; b=w4IMxoGV1ihoWEwTTSARuFIr8+iObJnHBKzm7srn9JMDU2PvmWCyvIY+4CMOvcj/pl g1ancYRniU5tUV9aSiqqIk7ginKLkgPXiv8yUZrLuBzrgrqf6GxViwe0WiBs0aMhveDu 7litg9dWfzDpiJmQxIagGOSgBSYPsvt5rlvf3MaJHFPmvYmt7xf8FTNZSR00ApxPrpTi aiBVHHsse3NEJI71yM0FCy+S1Spugu5FW3uB3ZAjJ0d+FGqK5BinAVxn4imd3w04MvE3 Uj+fPOegRcjR/Neonm27m2cgv/c/pPJ3HGmChQTEfQdpQnFO4XpXfsrnVgkYJJTe+ikb Qkiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=tglx@linutronix.de Received: from Galois.linutronix.de (Galois.linutronix.de. [2a01:7a0:2:106d:700::1]) by mx.google.com with ESMTPS id 88si15749302wra.283.2019.04.25.02.59.21 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 25 Apr 2019 02:59:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) client-ip=2a01:7a0:2:106d:700::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=tglx@linutronix.de Received: from localhost ([127.0.0.1] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1hJb9q-0001r1-8n; Thu, 25 Apr 2019 11:59:10 +0200 Message-Id: <20190425094801.683039030@linutronix.de> User-Agent: quilt/0.65 Date: Thu, 25 Apr 2019 11:44:59 +0200 From: Thomas Gleixner To: LKML Cc: Josh Poimboeuf , x86@kernel.org, Andy Lutomirski , Steven Rostedt , Alexander Potapenko , Alexey Dobriyan , Andrew Morton , Christoph Lameter , Pekka Enberg , linux-mm@kvack.org, David Rientjes , Catalin Marinas , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Mike Rapoport , Akinobu Mita , Christoph Hellwig , iommu@lists.linux-foundation.org, Robin Murphy , Marek Szyprowski , Johannes Thumshirn , David Sterba , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, dm-devel@redhat.com, Mike Snitzer , Alasdair Kergon , Daniel Vetter , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Maarten Lankhorst , dri-devel@lists.freedesktop.org, David Airlie , Jani Nikula , Rodrigo Vivi , Tom Zanussi , Miroslav Benes , linux-arch@vger.kernel.org Subject: [patch V3 06/29] latency_top: Simplify stack trace handling References: <20190425094453.875139013@linutronix.de> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner --- kernel/latencytop.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) --- a/kernel/latencytop.c +++ b/kernel/latencytop.c @@ -141,20 +141,6 @@ account_global_scheduler_latency(struct memcpy(&latency_record[i], lat, sizeof(struct latency_record)); } -/* - * Iterator to store a backtrace into a latency record entry - */ -static inline void store_stacktrace(struct task_struct *tsk, - struct latency_record *lat) -{ - struct stack_trace trace; - - memset(&trace, 0, sizeof(trace)); - trace.max_entries = LT_BACKTRACEDEPTH; - trace.entries = &lat->backtrace[0]; - save_stack_trace_tsk(tsk, &trace); -} - /** * __account_scheduler_latency - record an occurred latency * @tsk - the task struct of the task hitting the latency @@ -191,7 +177,8 @@ void __sched lat.count = 1; lat.time = usecs; lat.max = usecs; - store_stacktrace(tsk, &lat); + + stack_trace_save_tsk(tsk, lat.backtrace, LT_BACKTRACEDEPTH, 0); raw_spin_lock_irqsave(&latency_lock, flags);