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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D86DBC433E0 for ; Thu, 25 Feb 2021 13:14:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 816CE64F0F for ; Thu, 25 Feb 2021 13:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231439AbhBYNO2 (ORCPT ); Thu, 25 Feb 2021 08:14:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbhBYNOV (ORCPT ); Thu, 25 Feb 2021 08:14:21 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58FEDC061574 for ; Thu, 25 Feb 2021 05:13:41 -0800 (PST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lFGST-008RYO-Tv; Thu, 25 Feb 2021 14:13:34 +0100 Message-ID: <96d1f031409d87ff91582eb5b3c1db5af9832bf9.camel@sipsolutions.net> Subject: Re: [PATCH 4/7] um: time-travel/signals: fix ndelay() in interrupt From: Johannes Berg To: linux-um@lists.infradead.org Cc: Arnd Bergmann , linux-kernel@vger.kernel.org Date: Thu, 25 Feb 2021 14:13:33 +0100 In-Reply-To: <20210223161449.7461e0b6dacc.I3507b456d425cb95a092eb50b6cb491fe8575c50@changeid> References: <20210223152707.408995-1-johannes@sipsolutions.net> <20210223161449.7461e0b6dacc.I3507b456d425cb95a092eb50b6cb491fe8575c50@changeid> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-02-23 at 16:27 +0100, Johannes Berg wrote: > > +void unblock_signals_hard(void) > +{ > + if (!signals_blocked) > + return; > + > + if (signals_pending && signals_enabled) { > + /* this is a bit inefficient, but that's not really important */ > + block_signals(); > + unblock_signals(); > + } else if (signals_pending & SIGIO_MASK) { > + /* we need to run time-travel handlers even if not enabled */ > + sigio_run_timetravel_handlers(); > + } > + > + signals_blocked = 0; > +} This is, of course, racy & wrong - we could set signals_pending just after checking it. Need to make this { if (!signals_blocked) return; signals_blocked = 0; barrier(); if (signals_pending && signals_enabled) { ... Anyway, I need to repost this series, but I'll wait a bit longer for further feedback before that, since I know Arnd and others wanted to take a look at the IOMEM and PCI bits. johannes