Received: by 10.213.65.68 with SMTP id h4csp3542169imn; Tue, 3 Apr 2018 06:50:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx48HZRIMJZKg7t1xPjJt9rL60Km2BTe1YAtT23rC0qPdFh4xzippLE0hdlBHWL4EWowrSbrK X-Received: by 10.101.96.205 with SMTP id r13mr9420359pgv.427.1522763437552; Tue, 03 Apr 2018 06:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522763437; cv=none; d=google.com; s=arc-20160816; b=eDBLKq1Fg613MSHedF0s6BN2KTboZRgrkWLJDBdsGtoZoIJEhk/eQ7HNyd1kT0qNHr EjgCFhXjZ1rI6PtONjll0D41HHNuFyiIGHaH6cCAl3WdjT9qRj9crrOqGy6iap4p8d9W 0/bm0MKfJG2xC5JNh4KNLXH7pqgMdCPQFhYcvXMbXRMlMhHC34Sf2XrP/aRZTTpm2rfJ f/9zVHolIKfKBjLRMdudtLf1enoyGVbUbfJnwUSJzzXBSgb4yWveeH2t8F03MI5cFJuK jthxK1/Lmu3IyAQIXvu0Gm6MskGWxzGhDcqaM24cFclYTSs2lavW20psgLquuAJJEDdP PPMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=MFS6MqtbYca6YLTap9jw0DI4eQ0n9ucqUNaMwXVt+Gc=; b=YxrW5DhWv5HC5LJIPUSpmzAN6G9EHSIcw41Y1Nyk4nybU3sor2LIeFCA3d8rNOq6OB pLhyJZ9knQk2LUmuaIDgM7JGxFGeCMkhbYt8AdCQJN2YXJyIK2HjpcGyps0XsLzgwMRm VdDvEf3JvH27SdrVc+/rl8lHV32CvcSNn54iMmzfM8Y85upsDczPo0K90tcgmvQ5gcEN 8TGSS+WBhZWb80y5i9Z5OzN8RCrqJmloMFLdx0H94J98tTLU2prEm8WVcgfATQMsjnk8 olU95RZ6JxSBVTSqPWzsfPt7XgT9qlzkqKyqGAPl+MDy5uug+f2wYFXzmKG2f+7no0o7 gOnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=CKH2R7NO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si1974546pgj.618.2018.04.03.06.50.23; Tue, 03 Apr 2018 06:50:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=CKH2R7NO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751251AbeDCNtA (ORCPT + 99 others); Tue, 3 Apr 2018 09:49:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39852 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751048AbeDCNs7 (ORCPT ); Tue, 3 Apr 2018 09:48:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MFS6MqtbYca6YLTap9jw0DI4eQ0n9ucqUNaMwXVt+Gc=; b=CKH2R7NO/3SWCQXPIVHnlOjgG 0FQpRUAAM+gRsPg0ZzsefXWdTeqR6dxBZmKikcG6UK0tHLqTR+QxlNDJGdk5FiXH3gBrU0wBREcjn cy3KyVqx7dH376DxcRF3UMosCLuCgzSl/LrvUDVOG4LMZUIxDhf+nhsypJEkWqxNOIN3ctBwmOjqT c45JoypLJhJRKdyWK79rldArHdt7MLTOBpT1mdrch8dVHsnuVeWrLO7IRVaZEhl2Efb5YVZLGFPGx ja5WlRh++L3dRhZbb0FQA3SEnWsFhB6OKXyofmZY5FkfJBB5X+TjOIMDQighEEpYM10Wc7p987/iw KCoyolAqQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3MIw-0001wI-Gc; Tue, 03 Apr 2018 13:48:54 +0000 Date: Tue, 3 Apr 2018 06:48:54 -0700 From: Matthew Wilcox To: Chris Wilson Cc: dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Souptick Joarder , linux-kernel@vger.kernel.org Subject: Re: Signal handling in a page fault handler Message-ID: <20180403134854.GA28565@bombadil.infradead.org> References: <20180402141058.GL13332@bombadil.infradead.org> <152275879566.32747.9293394837417347482@mail.alporthouse.com> <20180403131025.GF5832@bombadil.infradead.org> <152276164305.32747.4969221700358143640@mail.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152276164305.32747.4969221700358143640@mail.alporthouse.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 03, 2018 at 02:20:43PM +0100, Chris Wilson wrote: > Quoting Matthew Wilcox (2018-04-03 14:10:25) > > On Tue, Apr 03, 2018 at 01:33:15PM +0100, Chris Wilson wrote: > > > Quoting Matthew Wilcox (2018-04-02 15:10:58) > > > > I don't think the graphics drivers really want to be interrupted by > > > > any signal. > > > > > > Assume the worst case and we may block for 10s. Even a 10ms delay may be > > > unacceptable to some signal handlers (one presumes). For the number one > > > ^C usecase, yes that may be reduced to only bother if it's killable, but > > > I wonder if there are not timing loops (e.g. sigitimer in Xorg < 1.19) > > > that want to be able to interrupt random blockages. > > > > Ah, setitimer / SIGALRM. So what do we want to have happen if that > > signal handler touches the mmaped device memory? > > Burn in a great ball of fire :) Isn't that what usually happens if you > do anything in a signal handler? I don't know. My mummy and daddy don't let me play with sharp things like signals. > Hmm, if SIGBUS has a handler does that count as a killable signal? The > ddx does have code to service SIGBUS emitted when accessing the mmapped > pointer that may result from the page insertion failing with no memory > (or other random error). There we stop accessing via the pointer and > use another indirect method. Any signal with a handler is non-fatal, and so a call to mutex_lock_killable() would not return if SIGBUS was delivered to a thread blocking in a page fault. mutex_lock_interruptible() would return -EINTR.