Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2793580lqz; Wed, 3 Apr 2024 08:46:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1BNgt/8naaFjZZaTkcrLELEFcJkbiWDSRZqf/LIFiWtmtLREHHF3tHSrEuN0lSsOUGovUrUj1YB4k5jgUPw8Pj9jZd+4PsBUgZ78nlw== X-Google-Smtp-Source: AGHT+IGVhJ48tRRF6P7xETdxcR3eP7DkIG/bro5AG8AlBGEsbkcraLPov94VS2vpTJULJnnqlLbe X-Received: by 2002:a17:903:1206:b0:1de:ff9f:aee9 with SMTP id l6-20020a170903120600b001deff9faee9mr19262346plh.11.1712159197283; Wed, 03 Apr 2024 08:46:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712159197; cv=pass; d=google.com; s=arc-20160816; b=WvZ1koyv9iHWq8ZYMotRoyJhiNIkOa0aB0FTrii1F1Nf5CmjbX4p02ykevw1oLt8I3 A+KrEKtyIYJwRDJECBqeAO0iEJ4/yrpxbtIetEqFnIqYjGrTl66eAxaylDqwwW6AzLXF wpG6VE1YF5NG0tXpre0g/ErJeOG7DzZ9DgXxxPZJTM384AY5pRLLmouEa/8nSVOyRdFE eVScDDbHOvZTpK3p3zk9wZpHhCn1oxA5tXzE+T8WJcabq7ilbKAuyUaBdqZwxnVBnuXL 4VWNn5Do7q9AwG0ILgAolVF2bZC9H4ct7qucduFFCzbjVsp+V4O6HHNlpJ/upG/JL+RS Uhgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=0ZWNUC2Pb10IDRHFLsN4mAj14Fjk7lK2G1G9BFqCQx4=; fh=OuAojZ9XtyzR6STIF2qTI9iuNn5xasdqzotJ7hmY3kQ=; b=O8YA8Y97tspyreizGi7Ff5BQMYO4oCIRu+/lfEdaaMGQYB19GBNYFJpE6sjYueTDxM HAciAbj+L7bklf4nI9JQrc4zoXNAKUTfJJtBWoHnfOFPeBZpklR2ru2zzyJeA3yzQD/G QUNjoDCqWVSSA7dwBZqDZdfkuOEXFQGrvK/es1J0410Nse9O65VUmu/nNNpGaunQrB5b +eDF7pwf1c4CWjXwowiL4SMCICA80CNOf0cOWHRojjw+5csoblfQ9Z1+CUkiPrmwNHFX aPe9EphULkrY2Do9i84Ykq9TJVWpFxpVHpeva6Mf/ub0f1RuVTKi/Ho6/gC4d1evxdR3 22mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sD3iALlA; 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-130116-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130116-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y8-20020a17090264c800b001e28bd89a7csi1880637pli.248.2024.04.03.08.46.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:46:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130116-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sD3iALlA; 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-130116-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130116-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CA6582823DB for ; Wed, 3 Apr 2024 15:43:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7432F14A608; Wed, 3 Apr 2024 15:43:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sD3iALlA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LXSNI6mg" 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 463331E871; Wed, 3 Apr 2024 15:43:33 +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=1712159015; cv=none; b=hpIkZO1366I2QrP5uiQ2UdmqsI9dqLOVC1BJ0NRBAtelmBBUf4CXOeYdrdb4YMNsSryJlydaP5AIYiLmVvIfJI4YpZ9eKPhyuEXnsJrri7/9/oobRXlaENqlEpaf7kxuvyZPESddM+ezKBfMwntjpjP8cgf/pTDyVtM0R4hxlIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712159015; c=relaxed/simple; bh=T6ATMPb0L6jQmUdZukRjg/J3crE9UrcQ5hjw5772x5A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=gEc+SA8FqPc+J8HwN+gqaHAZzRa6Rhm59WlkBfYaYVfSMCpPUwx13fbBqIO99tIMb9imsc/ffCAxb8LAfYGI0ygf1XYuKnNgJ5hBzUdWlyc82HOUIYtedJqUnrXxgbOJvImDe0EmAhoS9zel66fc3aCNzuce9Xnx5ES3seRDYgg= 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=sD3iALlA; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LXSNI6mg; 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=1712159012; 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: in-reply-to:in-reply-to:references:references; bh=0ZWNUC2Pb10IDRHFLsN4mAj14Fjk7lK2G1G9BFqCQx4=; b=sD3iALlAHq87Li0ITqAVHVUJn4FRxdTyg8m1gPG+LOzVvMQz2dTbiiH38ktFhrjm1TRzS4 Zo+ksm8rKsS8tcOEoKso1w455YUOP82JbFovRjNLSayXTnjD1YL/1XdzqJNBpJZuXz+26e /fSp8RhscDgr1RFB+MoIhbAVpqAKe4tfYUEV5nybg6BjFMW/V6Dg4kPcmDBky7LCbtYjU9 YMKMqzCB3NWF7c0OxRkDvYgijekaaTECxorL0Up4ZEqsF+BuHk9G1orAgUsp2Dbr0iwwMw t8fUCE1k92TiF8WGrWIEUUy3G5+GHhisJ2pg5r5ddK9ZwIuaYY15yvSrlXLIsw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712159012; 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: in-reply-to:in-reply-to:references:references; bh=0ZWNUC2Pb10IDRHFLsN4mAj14Fjk7lK2G1G9BFqCQx4=; b=LXSNI6mgfuJiVQShFc3oviDQpxtZXNLCZwsb+8sl4TKoEpTx9Ns389HsCAS6SYVbkSpjcQ G5ifs6gtp6y5PiAQ== To: Oleg Nesterov Cc: John Stultz , 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: <20240403150343.GC31764@redhat.com> References: <20230316123028.2890338-1-elver@google.com> <87frw3dd7d.ffs@tglx> <874jcid3f6.ffs@tglx> <20240403150343.GC31764@redhat.com> Date: Wed, 03 Apr 2024 17:43:32 +0200 Message-ID: <87sf02bgez.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 On Wed, Apr 03 2024 at 17:03, Oleg Nesterov wrote: > On 04/03, Thomas Gleixner wrote: >> The test if fragile as hell as there is absolutely no guarantee that the >> signal target distribution is as expected. The expectation is based on a >> statistical assumption which does not really hold. > > Agreed. I too never liked this test-case. > > I forgot everything about this patch and test-case, I can't really read > your patch right now (sorry), so I am sure I missed something, but > >> static void *distribution_thread(void *arg) >> { >> - while (__atomic_load_n(&remain, __ATOMIC_RELAXED)); >> - return NULL; >> + while (__atomic_load_n(&remain, __ATOMIC_RELAXED) && !done) { >> + if (got_signal) >> + usleep(10); >> + } >> + >> + return (void *)got_signal; >> } > > Why distribution_thread() can't simply exit if got_signal != 0 ? > > See https://lore.kernel.org/all/20230128195641.GA14906@redhat.com/ Indeed. It's too obvious :)