Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2769674lqz; Wed, 3 Apr 2024 08:09:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMa9Y1CAdELJraLN5ADEYTLDXAhNmJIi5zplN1LfTfo9SJf2RDkG4a/PWXtkOrFcgbdnw+/3dxVM/Vc/hAoHvbSzBQLLu/RmfF2x0xjg== X-Google-Smtp-Source: AGHT+IHoEz6Ssa9o2qEzppb49VLC0GQv1jDSAyrCZ+t1L28Rw9eOzMqgR7MBQQLyVOcsmhkkEYXZ X-Received: by 2002:a05:6a21:3294:b0:1a5:6a85:8ce9 with SMTP id yt20-20020a056a21329400b001a56a858ce9mr3657985pzb.12.1712156946899; Wed, 03 Apr 2024 08:09:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712156946; cv=pass; d=google.com; s=arc-20160816; b=Fyf6J6B9kBVhZXUk623A/tA6sCqX38nXDOJpdHz7W7LQCxqltf7m3BrMbc78yrqfnP VK/X3rs9XPVd/AriLTQ910wkW1hFgZqQuJQDFu4NDAesaCEuxNJlyZbvJZyI+zU7zKJn tnIEjxREIvVLESlXvkuc499qL++KUuHaziPtw90tMTJzGQNw9dsVLZWPCfPFyWS0IFie O84w/vJCUfcalhE3SNq7UrjR9Yqz5R5oVlQL2XuLZV1/Xe4hrFL5I3VObC/1OnD425hI 6t6tKAqvXqkM0gVjCAzfx4ve5aBR3ti8KbR4pYDnGoktTHERZo3Bos8r+GzrqlAspCP3 3iCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=UdTf2pSCOIaYn7Otxzx3C9HDo/HSUaFRAsJWaqzhTKw=; fh=QM13yX5cyx0gKVLH9qgXc292C0jk7N6nZCeRL8zZxhQ=; b=FbTWsANgJ5W8J8N2wZYvHI9rFrO6zH2XpFtIWYwKmVSVQSrIoqYpTkEfrSF+tXnBpx 41TWb70lDre6+apt4T2yZweNGvrPw/XKSF7a3daIJZ8oSEklDzcflAyIk6q0TPaptGKw BrYu0XnjpziApScFNPFFiUzvSd+wTuPfOKDdr9EpkZQMqNipYElvJdmLGGNvespKgCVj XFoq2CRDARfk87az+Sd+vTw7FGJeTwLFj1tXy62c9ShbXQoD0weeqk0KOPO9TT7DSsgy VjehuozYZ31WLgPV3Ku7f7ahzvYMRtdRBPSnLebQ//I5MlvHMI0RYZ2Z/C7ooYyqypa2 emmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YDvrYiSK; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-130028-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130028-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w9-20020a6556c9000000b005dc8834047esi12971803pgs.422.2024.04.03.08.09.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:09:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130028-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=@redhat.com header.s=mimecast20190719 header.b=YDvrYiSK; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-130028-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130028-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 4CA6C28BC44 for ; Wed, 3 Apr 2024 15:05:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7886148FE8; Wed, 3 Apr 2024 15:05:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YDvrYiSK" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 C2EC213A272 for ; Wed, 3 Apr 2024 15:05:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156740; cv=none; b=UoUsfkve9KIcKbud+n1L04JzyG/rYAY/TfxXkcfLFDlYj47gZg3P4qIjbmc5oKjU6WXOZYiEZRfjEkdBSfVvGm92SlWSwUO5PZ/r0Yct0P/FJS5PUQ4irP1r1B8Wwly+nnfMsR3xV8aBmP9A09aJnSdP7JKGZ+bBZgAqy2e8w1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156740; c=relaxed/simple; bh=deMENPl+c6MSxW2hu/QZ8GYeKyym0U74jnDvIEZWRPE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eqzDp03Sgy0mnf0O8CmrPJJw8ODuyWhOdwcz5vC4uHNC23O8PmqCiGObqb+G2ke9SR2BBWg0Y4dM1Y8qn36RvVmYmYFslphSA+gvBSYXH2Itoq0EYYD9fVKzUjpJhuSFV6IxAgq00caAaA98pJ5xWzP5+8+p4wiuFE1F/MK5ktU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YDvrYiSK; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712156738; 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=UdTf2pSCOIaYn7Otxzx3C9HDo/HSUaFRAsJWaqzhTKw=; b=YDvrYiSKp7Br8a3FVMdmAGwDHx842NlZ0CN0qm8azdv2YzzN8Z4JI9InYQr35JPLWj+avm N0KHfWuqcGT5tSH1J9SbIxPmvUL4R0wjY7GA9bOW+opUNh8tnGCviMoLFG+Pxt1VuuLwhS YevJZBSTZOWqCfXVGHQbA5Wmjo6JzEo= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-568-vxjWNBbPPnOwkeIjxQ0Jyw-1; Wed, 03 Apr 2024 11:05:32 -0400 X-MC-Unique: vxjWNBbPPnOwkeIjxQ0Jyw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B3B773822552; Wed, 3 Apr 2024 15:05:31 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.49]) by smtp.corp.redhat.com (Postfix) with SMTP id B6D1C4073487; Wed, 3 Apr 2024 15:05:28 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 3 Apr 2024 17:04:07 +0200 (CEST) Date: Wed, 3 Apr 2024 17:03:43 +0200 From: Oleg Nesterov To: Thomas Gleixner 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 Message-ID: <20240403150343.GC31764@redhat.com> References: <20230316123028.2890338-1-elver@google.com> <87frw3dd7d.ffs@tglx> <874jcid3f6.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=us-ascii Content-Disposition: inline In-Reply-To: <874jcid3f6.ffs@tglx> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 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/ Oleg.