Received: by 10.192.165.148 with SMTP id m20csp5047861imm; Tue, 24 Apr 2018 12:46:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/p/vkjGDHLEOztxTmZflVPUe7GrZk18Oe5b/6kUg3+KrS5oQRQnhfsP3ogBUzybkjCHyIj X-Received: by 2002:a17:902:44a4:: with SMTP id l33-v6mr25912026pld.27.1524599162550; Tue, 24 Apr 2018 12:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524599162; cv=none; d=google.com; s=arc-20160816; b=cb1CIFaMSoiZGT313O05/hBgHRaqyH4Jw5Dj4hG7tCjPwsKDSINtvTrDMQr0zhetqn Hb+rY3Vbg4ibg+5IAaTN91S9JEaUdBnH7NcTSpXbo59TQOf/59WPPuEqsndhb0RFRfbl LKQZ5VYK+UpcwGylpI4/uIEVqxYFxRGNOAGYYDyQ/2Rx1mtnjBGd/JLOqkwvt1MqSP+Q KK/O1APeBNVEVe8vGaC6oyDX2JSS6GBb2WmnxohDAqJfgDtu+v2XNVsteceBpZM+zdNB gKRlR5W2AoSEFiTx3iYx5GyljgfufjqqfIpIx4MA5Gn5nvknF4nV8yd7l2tuDktX4D96 ALfQ== 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-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=BeUO6C8w79t91ea4kqVqDv0B0WwCC3n9KaIpWyZBfyU=; b=haXDs419YMDMKdQ4jMxj9GDUlmUoKe+eX4ViRVH2tswgIjvsD5/rVQ/Dpefvaj+W4C dwPb+Fyv/NtMMqeXw6gMOOiCAUV/XPTLDG/BLyp9Q9/rbVjkJI4p4M9/1yjIUCsT7Ciw +k2QD8OkGg1VOAS/CxT48vI7F6FGDiRR5W/cuvtKgINQ1o8mCJdrH/rrQToPiftoIG6X fgqLKGDCdhJBRs28ELozDCJXULX30zxsxDlsTaJ/NwK9mo5PJsE2uoPVfhHsADdZ4gC0 9+2iku3zoHV4byN+TLJPuzktIVkRjZ4+Dhbi6zys2L1Hs+bT2XW+D7CXpLQMSEG3U1U7 ppxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=OIpYJ2pU; 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 9-v6si14583934plf.283.2018.04.24.12.45.48; Tue, 24 Apr 2018 12:46:02 -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=OIpYJ2pU; 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 S1751860AbeDXTo2 (ORCPT + 99 others); Tue, 24 Apr 2018 15:44:28 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36374 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbeDXToW (ORCPT ); Tue, 24 Apr 2018 15:44:22 -0400 Received: by mail-wm0-f66.google.com with SMTP id n10so2778990wmc.1 for ; Tue, 24 Apr 2018 12:44:21 -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 :content-transfer-encoding:in-reply-to:user-agent; bh=BeUO6C8w79t91ea4kqVqDv0B0WwCC3n9KaIpWyZBfyU=; b=OIpYJ2pUSz1n5fFOVudNn1znnivNTfvoY6vBM0xR6THIRq0LeKcMhKKvinOW6crNlq h0ayF66n+pTRB3pnt9b+X7UZl2FHyevZvzPKl2xpaTD4IlH8225uW8qBswJQOuWkb4az tJExHLi6Moni0GcpIP0rBwpKlxTTuNKLyJ4mc= 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 :content-transfer-encoding:in-reply-to:user-agent; bh=BeUO6C8w79t91ea4kqVqDv0B0WwCC3n9KaIpWyZBfyU=; b=MLXKtm2JEYe383Nt5yzcsJR2wSdTDrcsINKaB6rRDndqWju6djmzOg4I7OTnywk0Xc qz9Ze5FPgNl5UGsHM7/5EwMsOVMi8JBUaStP+NtmVrreDIxhXxM1cTz6svTrSynWRaQe gRjIJuPlRvBbyB/871s7RuO3HuAg3duxp60+G+6Cf3+7Af2TgqahTLdqNXQKi2upUm0E bQS0b2+zv6TbkY0A1IargN5qISJPbUXhT9rWaTTIOzP36SMHCyWPtMDSOqiCdT2Rec0Z qbqX1skphxHqhYsTq8+eLayY2ucnIGwZALz6vRAQx3x6C2U5HC6n+kvcbDMr4aEQmX/L n2RQ== X-Gm-Message-State: ALQs6tAVhn1tfHKNt1FbfXd0/WajGViqsDE+x3LRGOAX8q2BInehVY7O HojzF6AEcmdAvIefzIgWw/W/og== X-Received: by 10.80.175.100 with SMTP id g91mr4926273edd.57.1524599061045; Tue, 24 Apr 2018 12:44:21 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id p1sm8370424edm.0.2018.04.24.12.44.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Apr 2018 12:44:20 -0700 (PDT) Date: Tue, 24 Apr 2018 21:44:18 +0200 From: Daniel Vetter To: Michel =?iso-8859-1?Q?D=E4nzer?= Cc: Andrey Grodzovsky , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, David.Panariti@amd.com, oleg@redhat.com, ebiederm@xmission.com, Alexander.Deucher@amd.com, akpm@linux-foundation.org, Christian.Koenig@amd.com Subject: Re: [PATCH 2/3] drm/scheduler: Don't call wait_event_killable for signaled process. Message-ID: <20180424194418.GE25142@phenom.ffwll.local> Mail-Followup-To: Michel =?iso-8859-1?Q?D=E4nzer?= , Andrey Grodzovsky , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, David.Panariti@amd.com, oleg@redhat.com, ebiederm@xmission.com, Alexander.Deucher@amd.com, akpm@linux-foundation.org, Christian.Koenig@amd.com References: <1524583836-12130-1-git-send-email-andrey.grodzovsky@amd.com> <1524583836-12130-3-git-send-email-andrey.grodzovsky@amd.com> <7313704c-0693-0bb9-8818-99cd2b7c0ca0@daenzer.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7313704c-0693-0bb9-8818-99cd2b7c0ca0@daenzer.net> 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 24, 2018 at 05:46:52PM +0200, Michel D?nzer wrote: > > Adding the dri-devel list, since this is driver independent code. > > > On 2018-04-24 05:30 PM, Andrey Grodzovsky wrote: > > Avoid calling wait_event_killable when you are possibly being called > > from get_signal routine since in that case you end up in a deadlock > > where you are alreay blocked in singla processing any trying to wait > > Multiple typos here, "[...] already blocked in signal processing and [...]"? > > > > on a new signal. > > > > Signed-off-by: Andrey Grodzovsky > > --- > > drivers/gpu/drm/scheduler/gpu_scheduler.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c > > index 088ff2b..09fd258 100644 > > --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c > > +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c > > @@ -227,9 +227,10 @@ void drm_sched_entity_do_release(struct drm_gpu_scheduler *sched, > > return; > > /** > > * The client will not queue more IBs during this fini, consume existing > > - * queued IBs or discard them on SIGKILL > > + * queued IBs or discard them when in death signal state since > > + * wait_event_killable can't receive signals in that state. > > */ > > - if ((current->flags & PF_SIGNALED) && current->exit_code == SIGKILL) > > + if (current->flags & PF_SIGNALED) You want fatal_signal_pending() here, instead of inventing your own broken version. > > entity->fini_status = -ERESTARTSYS; > > else > > entity->fini_status = wait_event_killable(sched->job_scheduled, But really this smells like a bug in wait_event_killable, since wait_event_interruptible does not suffer from the same bug. It will return immediately when there's a signal pending. I think this should be fixed in core code, not papered over in some subsystem. -Daniel > > > > > -- > Earthling Michel D?nzer | http://www.amd.com > Libre software enthusiast | Mesa and X developer > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch