Received: by 10.213.65.68 with SMTP id h4csp3632469imn; Tue, 3 Apr 2018 08:13:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx497RL9JyRXtQFpvMTMolKASzLQBDwuVfRFRasNGCDQW/Hro2WrPaBBGAUNHkJJ1S29Gojch X-Received: by 10.98.160.92 with SMTP id r89mr10807999pfe.235.1522768439212; Tue, 03 Apr 2018 08:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522768439; cv=none; d=google.com; s=arc-20160816; b=ILA5NjzKKPdH/BMFITFpKlgvxz7CUwhmXn8640FBUuGqtyJmBIwwaxwbZJqKYG7BhV PeA4SoczCsvCWhVhGuyOV9TKs7wuHYXYf7/9tqkejZMrf3uPQPGqHs4ipEvShkrupaxl dTQHyNTWRadUbYmAAZYuphQddCgQKWk1wIuum2WhpN/tZgp/9oiqoFhlIksRye3cosNH lJX95nt8nyCQlhrziSy9qJl+zVhbzPGkhOrVF1oPUzwJXvN3eno2/KUgphy4zT1dELRA gAE9Dzc652K6Bv0/Ssqm2Lgz/iZVpb5PC+fDNIy1mD++1Iw7WI+pC5FQHgVY+g1zqJlR 25Qg== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=4ncFGLEek8SeofGw9G/K3LbY7FPeFte3oSD0y0B9/Wo=; b=kX6KMWR/Vb5J17IXlE3qKhqEOT6D/I/nH9lGyfcDIJ4gQ5oEJyQkwfHz7HsLYuHQ+s O6BWdAIqJ1DkM8qEAAuVcjAvDGbARjM3LClCyb4OjI7i2D2VNDHibxxG5eRHOipbJlrK YKsvy+veQiOWR/FluB4N1n4P1VYeBwEPP/C4Kh0aqTl6dIxj6937hgXGJyBJ6g8BksuE RhKSbZddNvzMK3ZE1Z1KxYUS91TejuXRo7KGwnuiIrtw0FoSBO1hzgViOOhSRMrlTI/q MrxZAssrwH//OWpU/4+flgjn0Mjtje+2HNYPQPdMTMUCpnYRGFbbQIRpopmeQr276nEK avOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=afoHv4Sg; 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 l4-v6si701407plt.660.2018.04.03.08.13.44; Tue, 03 Apr 2018 08:13:59 -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=@ffwll.ch header.s=google header.b=afoHv4Sg; 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 S1751933AbeDCPM0 (ORCPT + 99 others); Tue, 3 Apr 2018 11:12:26 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:37535 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751233AbeDCPMY (ORCPT ); Tue, 3 Apr 2018 11:12:24 -0400 Received: by mail-wm0-f49.google.com with SMTP id r131so35899371wmb.2 for ; Tue, 03 Apr 2018 08:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=4ncFGLEek8SeofGw9G/K3LbY7FPeFte3oSD0y0B9/Wo=; b=afoHv4SgZ/2mbZoheLrcSj4C5XP34em08+EG7L0hZGuRZw0eIiEmOcgvaDl/EuJY/5 hAwrj3nIp2BoL/R5mJW8DRoru6qUiMSwDV8q42Lbz2Lyi8NWmzcMcSYEljcCoF/9PtRG N6ldXhOYyKGW5raOshwYAa5KZRl03zBte/YAo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=4ncFGLEek8SeofGw9G/K3LbY7FPeFte3oSD0y0B9/Wo=; b=o40gbit//Hg0UO/cR3yQZUj29dqGXoj9AqDjSfrCplE58WBaHmxeY0L6FllpVPENFp qbpFeiqej8jYKiBTda0DATks/KDcnjmUcrKO0LJmlg0T0+VinG0yYvl9YWNa11bLqb+H QXdmdpbsZZHOeOp5e0ltvOyrGLETJjIqaQslAGdK8eNkRXgutFuplc/vf+wpKU8DGpWr J3FPnr77VMLGpCLjQq9KW58hdPoIsYrqYM//PoQld4pHRLHCPt73PYopP4PraUxqmdVt MHkOegyQrg/bBa4nJsKiLZ+Lp6DFZty0SdGpRXQicpbUO3W7pgft54KunAFWgJXhca2l QijA== X-Gm-Message-State: AElRT7GTpwdZwQhk7e1vpaDVAPoJILDbKdLr+EoGzCn6M9e1vE73EdQA y5Lb5+3Robbx3Me9ghUU6MvdpQ== X-Received: by 10.80.189.131 with SMTP id y3mr17207467edh.122.1522768343273; Tue, 03 Apr 2018 08:12:23 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id w4sm1845365edh.56.2018.04.03.08.12.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Apr 2018 08:12:22 -0700 (PDT) Date: Tue, 3 Apr 2018 17:12:20 +0200 From: Daniel Vetter To: Matthew Wilcox Cc: Thomas Hellstrom , Chris Wilson , 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: <20180403151220.GW3881@phenom.ffwll.local> Mail-Followup-To: Matthew Wilcox , Thomas Hellstrom , Chris Wilson , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Souptick Joarder , linux-kernel@vger.kernel.org References: <20180402141058.GL13332@bombadil.infradead.org> <152275879566.32747.9293394837417347482@mail.alporthouse.com> <20180403144829.GB28565@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180403144829.GB28565@bombadil.infradead.org> X-Operating-System: Linux phenom 4.15.0-1-amd64 User-Agent: Mutt/1.9.4 (2018-02-28) 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 07:48:29AM -0700, Matthew Wilcox wrote: > On Tue, Apr 03, 2018 at 03:12:35PM +0200, Thomas Hellstrom wrote: > > I think the TTM page fault handler originally set the standard for this. > > First, IMO any critical section that waits for the GPU (like typically the > > page fault handler does), should be locked at least killable. The need for > > interruptible locks came from the X server's silken mouse relying on signals > > for smooth mouse operations: You didn't want the X server to be stuck in the > > kernel waiting for GPU completion when it should handle the cursor move > > request.. Now that doesn't seem to be the case anymore but to reiterate > > Chris' question, why would the signal persist once returned to user-space? > > Yeah, you graphics people have had to deal with much more recalcitrant > hardware than most of the rest of us ... and less reasonable user > expectations ("My graphics card was doing something and I expected > everything else to keep going" vs "My hard drive died and my kernel > paniced, oh well.") > > I don't know exactly how the signal code works at the delivery end; > I'm not sure when TIF_SIGPENDING gets cleared. I just get concerned > when I see one bit of kernel code doing things in a very complicated > and careful manner and another bit of kernel code blithely assuming > that everything's going to be OK. I think you last line pretty much sums up the proper attitude when writing gpu drivers: https://i.imgflip.com/27nm7w.jpg Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch