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 BA78FC77B61 for ; Fri, 7 Apr 2023 17:47:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230083AbjDGRrs (ORCPT ); Fri, 7 Apr 2023 13:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjDGRro (ORCPT ); Fri, 7 Apr 2023 13:47:44 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD752B469 for ; Fri, 7 Apr 2023 10:47:42 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1680889660; 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=c0k1aH3SN6RIb4G5Py8osu0QB7lf5RDZkIrsmh2XPXg=; b=iAmuhZZ0LvoCUFe/y7VuyMmKTHOxNRXP81+ZpXXYxYOXLkFMPbcnFvh7F2UbujK0An98u5 2M+LK5EVTyFFQbhtXEZxTQzkIgh3sNK8CnEfikbatxJxpwZbfp0NlyADCEefzCgPCrRIma Xz+X+IrgSxCIAZJuVmjV4NDENXZU7XXUferzXMbIsaFylvlYRXvFyf/mjrRI8uSCcolblX 3FnEOlO639h4tg1VufBUkpowDxVm7AHbwNxgng0EqSciBa9n3ipWmBPxJ9GYaeZvHajWVi ZpZRe/Tf5OILFyST4dto9OOys4KvVgkea59T8efmU8nI0oH8m5use85+OFIN4w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1680889660; 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=c0k1aH3SN6RIb4G5Py8osu0QB7lf5RDZkIrsmh2XPXg=; b=xqhRk2V4R4Wghzp494BP4lRPr/lYX5QPjwfmGgNr46DKJYKkZjkH6Zf4Y8OGo+AfGQKDu9 pv9jIpnGq72RHkBw== To: Frederic Weisbecker Cc: Marco Elver , syzbot , linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Anna-Maria Behnsen , Jacob Keller , "Paul E. McKenney" , Peter Zijlstra Subject: Re: WARNING in timer_wait_running In-Reply-To: References: <87h6tsred7.ffs@tglx> <874jpsqdy1.ffs@tglx> Date: Fri, 07 Apr 2023 19:47:40 +0200 Message-ID: <87lej3twhv.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 07 2023 at 13:50, Frederic Weisbecker wrote: > On Fri, Apr 07, 2023 at 10:44:22AM +0200, Thomas Gleixner wrote: >> Now memory came back. The problem with posix CPU timers is that it is >> not really known to the other side which task is actually doing the >> expiry. For process wide timers this could be any task in the process. >> >> For hrtimers this works because the expiring context is known. > > So if posix_cpu_timer_del() were to clear ctmr->pid to NULL and then > delay put_pid() with RCU, we could retrieve that information without > holding the timer lock (with appropriate RCU accesses all around). No, you can't. This only gives you the process, but the expiry might run on any task of that. To make that work you need a mutex in sighand. Thanks, tglx