Received: by 10.213.65.68 with SMTP id h4csp3605866imn; Tue, 3 Apr 2018 07:50:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/oEiCB28+6iZOVcn4uuaPYW64e9Niq4QspHGrp5sS/BENvQqMvluzURfv1klPjPes2Ypzi X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr14787994plb.338.1522767020055; Tue, 03 Apr 2018 07:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522767020; cv=none; d=google.com; s=arc-20160816; b=f2s9B67FApaoIjuKJ54oyK9zPk76qpmqmnXA3KywDOH+y1Dr9DouEAOiUPnNAm89Fx rNsYn4FRaSs3hAtxj/n0r+nAc+ne0Hrfo4eBrZ2+PF/ycxJxlTHkxojfSK09Me83faKQ ToN17VcqQToQgiutghL+74GKE/OSnG8ApEnRd6plf93UzxwuD+7LVRckcnM9IwNv7NxR qABFfsYQTKq1GXHoXtwGop2Tur1hS3lREjMC90PgSGGo9a1ytPrru/chQGyz1Sb59rra Xv4A08NsKq07GiiGU9VG+pyWB/WzH/P+dScYOCQxy/hepe0Ijhj/g+cZGSCAHjdN2tJP HYbg== 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=KXN+uhVQdC5IoNL70Tbbs884U8/GNBRb8Te3O4AZYWg=; b=PTvCVVDLAVuRazaQRjnP2CXeWYb5bntKql8MqpU/UcO1M7y2suV0sHKEryWqgfEinG jt2u48YlQ4h/9ESn7PqWHXjTY62YBQeAsZgOejwomS32KgPfgR0CUUgL4FJDJzJRFDac HHAlfNXP+6FlEND6Q/Ltbcjo3S6/kq9KJxs3CL8cT//eCdr34ynRzcfBpp+OM+u+0+AN 0khaeNGUb/i6YOgnCQFThqAXlJuvNhm6+Xw7nOX9bAcUSNGq3VIeepfBvpOK9K2sKQ48 5aQHca20DZSMpphlTagVqA+1+OR2EhLLPCFoc/D7l1aftucAhe69kPib8p52Xes0KMIC jgZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=sN92vmFa; 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 1-v6si714871plo.228.2018.04.03.07.50.05; Tue, 03 Apr 2018 07:50:20 -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=sN92vmFa; 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 S1751567AbeDCOse (ORCPT + 99 others); Tue, 3 Apr 2018 10:48:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57386 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbeDCOsd (ORCPT ); Tue, 3 Apr 2018 10:48:33 -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=KXN+uhVQdC5IoNL70Tbbs884U8/GNBRb8Te3O4AZYWg=; b=sN92vmFa0IThVqnBEfJpnxVxt Qe6EzOb2zEITr2rordju48LudePr6Uq52eJMS6rxSk+Cp+P2zCQaNKioaI8/B+jwfJt51W15vTs7T 3G6apFpu2zyn+qpaHX4ruCmZB5vtGwMVhGNi2mFY4WMOnS9oQT9I9r81gGy4IkLmTOXQY1cmsHDDP 2unGqUMkK4Bi7yb5msK7vq2XjmxbTug9L2azG8WHdzRiiPNPx23501nuXe9Ts6fNQvjRWRkI169xu iMvla4N5mz1m874fYZl2WDTvFt1AM58/d0unI2yd6EjQ8mYKTYUzKscC6339ldZxkTPckB1/hAHrQ t0p/i+lNw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3NEb-0000yy-AE; Tue, 03 Apr 2018 14:48:29 +0000 Date: Tue, 3 Apr 2018 07:48:29 -0700 From: Matthew Wilcox To: Thomas Hellstrom Cc: 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: <20180403144829.GB28565@bombadil.infradead.org> References: <20180402141058.GL13332@bombadil.infradead.org> <152275879566.32747.9293394837417347482@mail.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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.