From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBFF2C27C76 for ; Sat, 28 Jan 2023 19:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234605AbjA1T5k (ORCPT ); Sat, 28 Jan 2023 14:57:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbjA1T5h (ORCPT ); Sat, 28 Jan 2023 14:57:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A06233EE for ; Sat, 28 Jan 2023 11:56:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674935815; 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=fNU2u372/7Sb65mBBFHPvq/vNgVTuST0kJLjueX9SFk=; b=dLtxH+p9abA8bVzEScWz7SBoOc/SlqwzVFWHADRBi/3iLQdK1QHpT5H2uva92XeG4sWjfo 5dPy924EEdtADAlHqFtJZ4L5cH6YSNSgJmNj5GoW46t/FHOjEy2MsYFZEbYXovIUaMN/4b FJL48ZuvGhOLpJ8GeuEiZvtzBl2B7yM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-665-fpCfCplIM7irVfEIzo9Tqg-1; Sat, 28 Jan 2023 14:56:48 -0500 X-MC-Unique: fpCfCplIM7irVfEIzo9Tqg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 69FED101A521; Sat, 28 Jan 2023 19:56:47 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (ovpn-192-101.brq.redhat.com [10.40.192.101]) by smtp.corp.redhat.com (Postfix) with SMTP id C490C1400B19; Sat, 28 Jan 2023 19:56:45 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sat, 28 Jan 2023 20:56:44 +0100 (CET) Date: Sat, 28 Jan 2023 20:56:42 +0100 From: Oleg Nesterov To: Dmitry Vyukov Cc: Thomas Gleixner , Marco Elver , linux-kernel@vger.kernel.org, "Eric W . Biederman" , Frederic Weisbecker Subject: Re: [PATCH v4] posix-timers: Prefer delivery of signals to the current thread Message-ID: <20230128195641.GA14906@redhat.com> References: <20230126105128.2249938-1-dvyukov@google.com> <20230126154118.2393850-1-dvyukov@google.com> <87o7qlgjce.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dmitry, I agree with what you said, just one note... On 01/27, Dmitry Vyukov wrote: > > After this change the test passes quickly (within a second for me). yet perhaps it makes sense to slightly change it? It does +static void *distribution_thr(void *arg) { + while (__atomic_load_n(&remain, __ATOMIC_RELAXED)); + return NULL; +} so distribution_thr() eats CPU even after this thread gets a signal and thus (in theory) it can "steal" cpu_timer_fire() from other threads unpredictably long ? How about - while (__atomic_load_n(&remain, __ATOMIC_RELAXED)); + while (__atomic_load_n(&got_signal, __ATOMIC_RELAXED)); ? Oleg.