Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3006137lqz; Wed, 3 Apr 2024 15:25:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUeDyUD6U0JO/VEPhRsxexcRp49XkodJ+9S4R9lOCXNAKWuX9pRKC7UjmQj9h8mT31++azCknxJmWqrzHv+aF+m3NTloDK6A9VLi5TnaA== X-Google-Smtp-Source: AGHT+IH9Wm5iQMXC6RD7wMABmXwHu2OxqFXJN0XULICUZ2xfiNNIoZxsTFTi8OubV9DYY9Tc7PNl X-Received: by 2002:a05:6214:da5:b0:699:1176:8dd1 with SMTP id h5-20020a0562140da500b0069911768dd1mr706733qvh.24.1712183113656; Wed, 03 Apr 2024 15:25:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712183113; cv=pass; d=google.com; s=arc-20160816; b=SGhHtj50EnF1DS1jGVpOP+V+eDBwzhTOfBBe/xA+BvZJ8fDbts38XfPafoXhO1vt1x atU0Bxj3850RIm4DdtmAhJQLAkPVL9rqplX6aGD0G/Da0otBvQjiJl3jG6va0on10WQW V3XlYTNkTqAlNdLJlQl4ZKITaDBnJr9NSJ0fmQEW8QMjHap7v7urae/hFJ7OYczetgmB qxbj+flcRPW9zX3GElAlwWgXMmaMbJN9CZi0bp1k0LA92rX1BTYzVruADCjOT9wYrBk4 VBCj+SBcjNzyKYNn+pIfkfZiq8iV7OYL0xrfNk8361ErRexrvesaZtg4as0DmZA1bNIC yOWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=c3YFPvNQqpuZ+J4wj70XcY9sGKlu8GfBq1D4XGyQln4=; fh=G67xwWJgg4YQhqnTeUhp4AIhy/KgFs0OqB6nXUYmW+Q=; b=qtpQw8Rln5KLlLk+lci1LegNMDrd1gcS5AP7y+GYdPIqxY7Sx2+xsIkbbc/6dVHYby NJ7/lA4+T1r6YpQxGecuWixXkofpZh+xjuQlCYuDKUvhRyyts6Pn98BIm0vpLXjQ4okF EqDx3Ufn2SbMbHq6jzAfC6cxfzMdkhOO6HZZKTBNBSCNAm6sfJHWS1QxLXSQboZdRFci ewK03vuF+y7s+Fwiaq9C98lNkTXBPPc063QopPbbYSWg2lq2qb+/9OhsZIqpoYTk+znz QEbpGVVRT0+q2uMhW62srFX96Xp5Zh66DLkIcMbUsm6NUydJAEeF1nwhPuGcVKMadC/E i6qg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iEzK0h73; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-130681-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130681-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i15-20020ad44baf000000b0069925f16f26si2773507qvw.16.2024.04.03.15.25.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 15:25:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130681-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iEzK0h73; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-130681-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130681-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E93231C272BC for ; Wed, 3 Apr 2024 22:24:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 654FA156987; Wed, 3 Apr 2024 22:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iEzK0h73"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="F+/te/Q4" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17797156966; Wed, 3 Apr 2024 22:24:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712183064; cv=none; b=eRaScGEeOZb4e/ECK8H3xRAzE7jEMpGL4RDeddqINBnXiTrMs8HgV0j5Vz/h8SIuTn2W60g/cmTcQXvU0J+Awm4HCa88FZJrl1U7VcBCxeP4uOy11MJqUJM3lFWuh4zeFGK2Rm/x72OsaKt43ORrZRdXqr0vDgDGyUiBmvZKfJY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712183064; c=relaxed/simple; bh=TEp7+Qiyo82s+1tiadbpVHFDh224LahtR7+iS2DB1/4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=aZ/JzQYfLJmnFfVD+ktTZoHsnQLsIjYXEcK3KUpcw2gvrODLgaclLP5K+lTeUuLRh0qmUj0W5mIWiIpduPFFYdQkVBszjyjKcQD+QCBvb5CKq0ugs/RORvlsPIntpsoghmzVNYVvjtue+xGyhCgLCF/ep60uNMmuKmrESaxi2RM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=iEzK0h73; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=F+/te/Q4; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712183060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c3YFPvNQqpuZ+J4wj70XcY9sGKlu8GfBq1D4XGyQln4=; b=iEzK0h73bJZnELeHznNtxplvE+IZX5vy9DG5U104MYJjcdtkjpByoyiqR1I2myvBSrgG3g TOT3WPqydtip+Ib+cTgo373q5zZiBH1nOFcm9P6PQRd6R/CdriImzB9FBPBdTX0KgPQUf8 RCfA9v67fZPqU20NVULL7ioeoKqV7f9MK0zrwJKpTD0NIcPezUmsDxanW/NWWiuW0WZJNU Hq7LxfA3LcdX2t0D4EWDyOQVtbidlsyvpVrNk8K23w+/VCeHH9yjC+YMkiqY2ckL4B94UW EI+eKyzrNcF49QyvojPUcAMkDwu8bY+6ZhDd8LFZ1+PXAjMjiqhJ+0+Ka0PuqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712183060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c3YFPvNQqpuZ+J4wj70XcY9sGKlu8GfBq1D4XGyQln4=; b=F+/te/Q4J9hwYmJ2XOE5oHMCodz5CX1FL7lExc7xTFaQmhwzYWPIjNGTS2B9ivLXz2lvd9 /K68co45wZidz1BA== To: John Stultz Cc: Oleg Nesterov , Marco Elver , Peter Zijlstra , Ingo Molnar , "Eric W. Biederman" , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Dmitry Vyukov , kasan-dev@googlegroups.com, Edward Liaw , Carlos Llamas , Greg Kroah-Hartman Subject: Re: [PATCH v6 1/2] posix-timers: Prefer delivery of signals to the current thread In-Reply-To: References: <87sf02bgez.ffs@tglx> <87r0fmbe65.ffs@tglx> <87o7aqb6uw.ffs@tglx> Date: Thu, 04 Apr 2024 00:24:19 +0200 Message-ID: <87frw2axv0.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Apr 03 2024 at 12:35, John Stultz wrote: > On Wed, Apr 3, 2024 at 12:10=E2=80=AFPM Thomas Gleixner wrote: >> >> On Wed, Apr 03 2024 at 11:16, John Stultz wrote: >> > On Wed, Apr 3, 2024 at 9:32=E2=80=AFAM Thomas Gleixner wrote: >> > Thanks for this, Thomas! >> > >> > Just FYI: testing with 6.1, the test no longer hangs, but I don't see >> > the SKIP behavior. It just fails: >> > not ok 6 check signal distribution >> > # Totals: pass:5 fail:1 xfail:0 xpass:0 skip:0 error:0 >> > >> > I've not had time yet to dig into what's going on, but let me know if >> > you need any further details. >> >> That's weird. I ran it on my laptop with 6.1.y ... >> >> What kind of machine is that? > > I was running it in a VM. > > Interestingly with 64cpus it sometimes will do the skip behavior, but > with 4 cpus it seems to always fail. Duh, yes. The problem is that any thread might grab the signal as it is process wide. What was I thinking? Not much obviously. The distribution mechanism is only targeting the wakeup at signal queuing time and therefore avoids the wakeup of idle tasks. But it does not guarantee that the signal is evenly distributed to the threads on actual signal delivery. Even with the change to stop the worker threads when they got a signal it's not guaranteed that the last worker will actually get one within the timeout simply because the main thread can win the race to collect the signal every time. I just managed to make the patched test fail in one out of 100 runs. IOW, we cannot test this reliably at all with the current approach. I'll think about it tomorrow again with brain awake. Thanks, tglx