From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F2832E6CB3 for ; Mon, 30 Mar 2026 14:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774881342; cv=none; b=Mm9nDuhZtzN2tZdKKmWsYAK4FR/P4UD/K9jRfj4EIRtWEfKbEaQnmfLAN0TentLzknhzSq8LDWmefIV4Nvjr1c3DpYpBmoKyhJAS6xEjGKFcquO1TGOjIJ3blxd+6Hm8y34I9ZamoE6TULBY1C4FIgNx3e40+jrqsDKQXMz77/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774881342; c=relaxed/simple; bh=UkVa6cmf3QGn7h3L7OioSsm6tUbCai0QK/j4KgC0qNc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YBFEWRO1eJ4XwQKgUjekw14v5iFBZOSPZGRfIGdprHJWnV3jWomWVqr9nAeanqJra3xVaO81oLaWG80YugoxhTyTd6690fplO0d0XdOdMa0z8+WGAlLwQtlIy2HIINhI92nPtsEitvi6Nb9nAEi46GVYnSg46NQzPA5r74ZOYDA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=eTA9qv/G; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eTA9qv/G" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-43d01d6b50cso676439f8f.1 for ; Mon, 30 Mar 2026 07:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1774881339; x=1775486139; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OABjowBdKssAqbCjvzHnHU7J4j90A7eNOnV4X5RcKF4=; b=eTA9qv/G+r8NX0QjJ+L+MlMygPRWWvzjnXw6vM7FWuTC6H4qP1OyRM28sh85UNxVBh TkUO6jtZFr6EWmi3q2W/y0gyJK6n/LbVvoFiumTb5kfTBbnZlE85iqUOTkKxSgdemogQ v/pkdNRiBm4CcVAqbPYTX/A4ryd74QXC2D5ziqNmyYJqWtPCMAcHWVimDNMexcvHSZST uNoRp/IcjAbCZ8KLYPry4rgztBM6rY4/5b+1u83xl8vcKLTbsInMHYcybBluzKrzb/h4 mQprIqRCVRcwYh06l2KRm3WS6AB6k6oQ14FUlpS6ffdU5UEQywmvhdEkkIIjLHi8zIps PBlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774881339; x=1775486139; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OABjowBdKssAqbCjvzHnHU7J4j90A7eNOnV4X5RcKF4=; b=nWB7zi7sbzqYRwtTdCUl0VKTgVzd7MgqnXAZP4bxS/frnrvIT5eRSHuR+JRyE9ijd8 XF5ppXB9JHnRhnZj7M9B/ddq/U0A9/PFJ0hP30EGdTdGpBzdCRS0zWJgEat46XHiudoB sBzSBQh8d61L2G7deXS3k0jplSg+fSdMkY7jnG6AOV9tL4uUDnVaS3BsAUOKOMsOHuEI 1n5pn8hfKShnNrtd2bViAy80wMkyMy4ZDQu7UC+JvETEJQWvN/p5A5xbHy361+PyXQA/ Tryp89y7YD+nhJeIYGnAGhrxu/nIdotMfFBM0xllORc1++0QuvvNCvGmmI2ys8wTAAo/ AJhQ== X-Forwarded-Encrypted: i=1; AJvYcCW+HNPDDeXgp/o4yvf9ANkOaKPYZ2Wzdvn2M1/bz/xMtWyIju/sPBXxkcemZhqHvNSz2daOzgBCxkC2A9k=@vger.kernel.org X-Gm-Message-State: AOJu0YwiSqJWw8OUO+v7tfzHEQhwSLeBNeRRyj7ryqFOEkyH0EVtqhjn FhH2Z+EUWPjz5f2FdhozqrlNDhy6d18vYOH8c+rMM1tu0sdgi3VR910f1Tj3vMN9pZY= X-Gm-Gg: ATEYQzxcPrv0kR/8xLP7WjEvf+Zvfk4UalEf+XNTsrvu861Br3HN4Ou/iIEH7LZMFRY 7KritBzMFeTZeL7mcC46hSez0xKWU72LLT6MRrxmfMOnCWrH7/JLo/zGAAXNDyxlrl+X+jm7VPJ mqwGU0jcdU+aOUCxJRC+K+QCGa8Pb2soRI0JmsUQUJCzkNE2t0l5aJVKcXakUrbbHtnuNSU+c6v M4WpOpaf0duwtKHnNenRjASTaZcJ6xhaJ2dKxu9qiD9F9X1yQts4jxO1Qt5O67IzjwAJ8nQ/PaJ EpJ8drcCtUsowSC70sPLEwGsp74zBAD3/BohgY2VHrLBe7J+Spc2StmLg8plLbdfo6ZAmn/YcCr 6yHmZUdvgcypXfbYsRKYNvbsBDQTFia9WFVUmTrn25gtKyo3RIDOHuYKSwgVJTHzn1Jz5mn09G4 VA53kfiCgnpUrzIu2bt69428LZu2cC X-Received: by 2002:a05:600c:8b63:b0:482:f564:d613 with SMTP id 5b1f17b1804b1-48727eafa46mr190145605e9.15.1774881339360; Mon, 30 Mar 2026 07:35:39 -0700 (PDT) Received: from [192.168.1.3] ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4873cd7d039sm70710925e9.15.2026.03.30.07.35.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Mar 2026 07:35:38 -0700 (PDT) Message-ID: <3e218109-261d-4046-8cac-86aa1362ddda@linaro.org> Date: Mon, 30 Mar 2026 15:35:36 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 07/10] perf sched stats: Add support for live mode To: Swapnil Sapkal , Ian Rogers Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, james.clark@arm.com, ravi.bangoria@amd.com, yu.c.chen@intel.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, rostedt@goodmis.org, vincent.guittot@linaro.org, adrian.hunter@intel.com, kan.liang@linux.intel.com, gautham.shenoy@amd.com, kprateek.nayak@amd.com, juri.lelli@redhat.com, yangjihong@bytedance.com, void@manifault.com, tj@kernel.org, sshegde@linux.ibm.com, ctshao@google.com, quic_zhonhan@quicinc.com, thomas.falcon@intel.com, blakejones@google.com, ashelat@redhat.com, leo.yan@arm.com, dvyukov@google.com, ak@linux.intel.com, yujie.liu@intel.com, graham.woodward@arm.com, ben.gainey@arm.com, vineethr@linux.ibm.com, tim.c.chen@linux.intel.com, linux@treblig.org, santosh.shukla@amd.com, sandipan.das@amd.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org References: <20260119175833.340369-1-swapnil.sapkal@amd.com> <20260119175833.340369-8-swapnil.sapkal@amd.com> Content-Language: en-US From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10/03/2026 10:08 am, Swapnil Sapkal wrote: > Hi Ian, > > Sorry for the delay. > > On 04-03-2026 00:17, Ian Rogers wrote: >> On Mon, Jan 19, 2026 at 10:02 AM Swapnil Sapkal >> wrote: >> [ snip ] >>> +       /* wait for signal */ >>> +       pause(); >> >> I'm seeing the perf sched stats test hang here, requiring me to kill >> the perf process started by the test. It is unclear what signal is >> being waited upon, but is there a race condition where the signal >> could have occurred before the pause? Should the pause at least be >> conditional on that happening? Given that a race condition would exist >> even with a test, would it be better to use a condition variable? >> > > I am able to reproduce the issue. There are other places also where the > same issue can be reproduced. (e.g. with `perf lock contention -b`) > > I will propose a fix. > >> Thanks, >> Ian > -- > Thanks and Regards, > Swapnil Hi Swapnil, I'm also seeing the same issue, did you come up with a fix yet? I think checking the finish condition in a loop would work as long as it's sleep() instead of pause(). Or if you want to use pause() you have to mask the signals before launching and then do a sigsuspend() to unmask and pause atomically. I was able to reproduce it every time by using the runs per test option: $ perf test -vvv -r 10 "perf sched stats tests" Running multiple in parallel also showed another issue because the test writes to and deletes perf.data in the current working directory. Usually the tests do mktmp somewhere so they have a unique output dir to not conflict with other tests. Thanks James