Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp643969ybz; Wed, 22 Apr 2020 05:22:35 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6Fc9YNe/2m+GErSQZX0e/SWHI3z/nz92Fjpzl3tmGUbwTniEtfvJNe5LcpLkxm0GG1Qef X-Received: by 2002:a17:906:6444:: with SMTP id l4mr25136517ejn.313.1587558155671; Wed, 22 Apr 2020 05:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587558155; cv=none; d=google.com; s=arc-20160816; b=X7VdfxZ66pLP29qg7OQSAmq5UkWI7yPWPueDfGEBNug16BjQ6aM6M5ak2Ppia9lpFf SHvsyGognihwkP1GlMFvcJdrEwcmSe3MQss7bzEgxE58bAo8uWRC32LDSRRL7SlDsAbv q9GIwuQfoqFuBjtvXwLMyM6z5SVUpo6H/ptR3v/E5vvi1zoBkfqfi4l0ENM7qfUG8/ZU 0Lv7uVI0tRhaQ7xxh8k4rjhDXSbsaH1ayZXVtIlgOBtNHzAoybnetywX4a7F9l0qKqMx SRChWW+AkZD5J9SV47OhU7dG2RhimGp6yj0L/L/57+lgJ33beZOWWaKQISWdxG2qUUr/ 9ASQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wZ0p4Hhs5HsT17OQnhQLhdownV92u8lFucjpez5YvWA=; b=TaQYWg+9PDVhZKfpRMpxEleZLxodUiQBu4HfX4HPGHkXCyH9jYJKm8yURuu8DP0TOf +j0rC44nDWc/Ot1tX/TqcJzHAxygcQHB9zdahh13HmgNu02d6Nhbqw2ZH0DNs7zi6E3N eGXohNCoCf7kDN50iR9ukKjkA1VTpGL9hnLXUgM6nZSAXZVVXpKnF7zlV301NVGWXpUE nGuYXgDG9a41zaa+urt0Wt1Ayu1tfsq7QWsFMvK22rMUAKRw9cWFWplBvolaHxEJaztu EqLA0gg/jgvFanwnUwXpKbEjJJJ50JLE0Wpg0h2R2LfyP0DOs86EyMydgntIxzM/7Bli eXTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=abhs4m5e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si3279427edt.576.2020.04.22.05.22.12; Wed, 22 Apr 2020 05:22:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=abhs4m5e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731225AbgDVKdu (ORCPT + 99 others); Wed, 22 Apr 2020 06:33:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:33010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730436AbgDVKYh (ORCPT ); Wed, 22 Apr 2020 06:24:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2DC3A2071E; Wed, 22 Apr 2020 10:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587551076; bh=yq30A9vqJkbH6ukTYjE1PX100A2RCzQdapYKRI6/qVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abhs4m5evGEJx/jChiLvEgFZgIBTzyPtLDm1rzAAdrNxU52Z4R5B0FU+eGytBvZ4o st6Cn3QD6UmC5si4yFFF09HBgG4LHs2ks1/vdS1lFiBtWn3W1uUP2iJYi0gZf+seZV ZiF0IiIIcsJaCbPeLtiIijTuy6hi9RbLE0PwSUik= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Richter , Vasily Gorbik , Sasha Levin Subject: [PATCH 5.6 091/166] s390/cpum_sf: Fix wrong page count in error message Date: Wed, 22 Apr 2020 11:56:58 +0200 Message-Id: <20200422095058.435527979@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095047.669225321@linuxfoundation.org> References: <20200422095047.669225321@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Richter [ Upstream commit 4141b6a5e9f171325effc36a22eb92bf961e7a5c ] When perf record -e SF_CYCLES_BASIC_DIAG runs with very high frequency, the samples arrive faster than the perf process can save them to file. Eventually, for longer running processes, this leads to the siutation where the trace buffers allocated by perf slowly fills up. At one point the auxiliary trace buffer is full and the CPU Measurement sampling facility is turned off. Furthermore a warning is printed to the kernel log buffer: cpum_sf: The AUX buffer with 0 pages for the diagnostic-sampling mode is full The number of allocated pages for the auxiliary trace buffer is shown as zero pages. That is wrong. Fix this by saving the number of allocated pages before entering the work loop in the interrupt handler. When the interrupt handler processes the samples, it may detect the buffer full condition and stop sampling, reducing the buffer size to zero. Print the correct value in the error message: cpum_sf: The AUX buffer with 256 pages for the diagnostic-sampling mode is full Signed-off-by: Thomas Richter Signed-off-by: Vasily Gorbik Signed-off-by: Sasha Levin --- arch/s390/kernel/perf_cpum_sf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c index b095b1c78987d..05b908b3a6b38 100644 --- a/arch/s390/kernel/perf_cpum_sf.c +++ b/arch/s390/kernel/perf_cpum_sf.c @@ -1576,6 +1576,7 @@ static void hw_collect_aux(struct cpu_hw_sf *cpuhw) unsigned long range = 0, size; unsigned long long overflow = 0; struct perf_output_handle *handle = &cpuhw->handle; + unsigned long num_sdb; aux = perf_get_aux(handle); if (WARN_ON_ONCE(!aux)) @@ -1587,13 +1588,14 @@ static void hw_collect_aux(struct cpu_hw_sf *cpuhw) size >> PAGE_SHIFT); perf_aux_output_end(handle, size); + num_sdb = aux->sfb.num_sdb; while (!done) { /* Get an output handle */ aux = perf_aux_output_begin(handle, cpuhw->event); if (handle->size == 0) { pr_err("The AUX buffer with %lu pages for the " "diagnostic-sampling mode is full\n", - aux->sfb.num_sdb); + num_sdb); debug_sprintf_event(sfdbg, 1, "%s: AUX buffer used up\n", __func__); -- 2.20.1