Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp384843pxb; Thu, 25 Feb 2021 05:18:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVS0LHxQc1W+nl4ywEl5hPXafY36a0HGILiZ/2YzqLWzeWpviuEL2aZkac8fo7FGUWCY3R X-Received: by 2002:a05:6402:50ce:: with SMTP id h14mr2820789edb.283.1614259110961; Thu, 25 Feb 2021 05:18:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614259110; cv=none; d=google.com; s=arc-20160816; b=RuoA9GOXKVTQJQuLR7IpIPM4RqRqu5LRv87rMwzaKDQ9YdL2vW95STKJ6kqKepTy3u RVHwzm/pf2xtSdRFRgJUXlyLfmB3s21EKQJZ12V4QMeCiwin/6yjRlbo2T1GXG9qImvR /6iSd5F/48FO2kWunvn8G1SqM8UbCjZ3wJv3C025iDatO6JzPef/DROTEuH3x689lukR b3AUaCDDuRDefwNYymDULrLY+dt6Kso0aB5/t4zRva+gObCwYH76GzVR0rmB/IJBLciV fMCXen5Ldz6KVsiu5NahxX6vNRUfqLEfZDfVcjFGc2nABsznjE+M9EVW/7bVOW/BEYyg pZPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=Uryd3CDUMuD70fTR/X2uTLgs1qZAxUJY58F1jmg6I2A=; b=ZMfaTKVOWUhG0w7AZE1mK5hHvO7dMHJAAawkhAYHy2dVEfh1+Kcmyzx2+o528N3XV8 NvJBSFmsuYNTD0S9hEIT7Uf543/hFmhs8D30ATAOJTJpuQDmqFFY/8Iuwu9fQudKTiuk DDxy/irzI89gKicYCDKlTUWgyc6OpHS7Ro21k1armBzHOyx9Ev9nmVV7WO+6M4t6Nm1a zxvSSh7Fq15Y/EzKVX4bPUHfCo94av+Gk2ELMjO+Q/HI3bUnbJGKt8uza74JKz9S5q+8 X169DNXFVnlkHC+DllWNriNxmGO0qSMtL3cYeyh3Se9JK6Kw1oYDJkv6ZXw95CFTdKj+ z7aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k21si3141724edo.563.2021.02.25.05.18.07; Thu, 25 Feb 2021 05:18:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230371AbhBYNO0 (ORCPT + 99 others); Thu, 25 Feb 2021 08:14:26 -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