Received: by 10.192.165.148 with SMTP id m20csp688992imm; Wed, 25 Apr 2018 06:15:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49sbMG2GvzEjWt16sSBP/KrE+3ulzQF0MLf3+4KyK/d7QUACH4uLCstiCNZALdqo+U+z2qm X-Received: by 2002:a17:902:20cb:: with SMTP id v11-v6mr28601615plg.82.1524662123833; Wed, 25 Apr 2018 06:15:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662123; cv=none; d=google.com; s=arc-20160816; b=nbZWgj1Y/OikW22opQc69QyL+yhQaCG5oOuUp+liHCgeqSuMB5X8hF+TFQkMr5IU/Z Gw6kVqvuzQlat659sWH1WS88BX6OsWgHTCq+iFATTBLEdc+kBPgcCFba8J8G2p6UOZnE 8FxuHlYwqZ4W7hXieqHZWinnPUT9LUnMGNo6ZYlyf3i7BO/etQhuDI8XuDrelAWn6Jy1 dp1hUEyJ41oB9El8Db+r48vsLMuc4v3UbqKVkMEiph7XTvHgTX69ZLM/xUz1VWWEjewm Hc9Fpxdowip+h/mGbXk+9UvhrimL4+K8gRYesvzCtWIsrHX/nsKedQxoXLC9Ka77O+YW rLwQ== 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:arc-authentication-results; bh=JOgSommvEZcekO/Ey4v8YtA30V+iiTlc62Kar4LlvyA=; b=mFLL7ECjPA9s0hACX5ix4hWvl/cHXKg/ja8nWS6dn2gjVXeiYSmTg/4qrfpbr+SLhr vcl7SfVowZmb4CJ4/vbg7dKVRCbRE79BBc2T2RUQH1LybRM7XCYLGyIXP+qO27VfZkJK OUzWGVhQo/QxpxKJg0chnmfnEOQcxQ3Raplni3TcJfX3gApqy9ghcVq8ZtQMDBlRRedR xVr6opY2L02N6IK1sMFrXPjKNh8hwlGI6/njXrWyL2Br7vmOoacStp3W9NT+77HgxX9U eoPn3OzlYat3pV+g/BO6Y8LsHGPJZ1jWOei8jB6tmUFrJlvrEnmieKV07g2lJblFtYs9 AQiw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3-v6si16487057pld.309.2018.04.25.06.15.09; Wed, 25 Apr 2018 06:15:23 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753997AbeDYNNy (ORCPT + 99 others); Wed, 25 Apr 2018 09:13:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59480 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752349AbeDYNNx (ORCPT ); Wed, 25 Apr 2018 09:13:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DCB681A32CD; Wed, 25 Apr 2018 13:13:52 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.34.27.30]) by smtp.corp.redhat.com (Postfix) with SMTP id 53CA72024CA4; Wed, 25 Apr 2018 13:13:51 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 25 Apr 2018 15:13:52 +0200 (CEST) Date: Wed, 25 Apr 2018 15:13:50 +0200 From: Oleg Nesterov To: Andrey Grodzovsky Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, Alexander.Deucher@amd.com, Christian.Koenig@amd.com, David.Panariti@amd.com, akpm@linux-foundation.org, ebiederm@xmission.com Subject: Re: [PATCH 1/3] signals: Allow generation of SIGKILL to exiting task. Message-ID: <20180425131350.GB7592@redhat.com> References: <1524583836-12130-1-git-send-email-andrey.grodzovsky@amd.com> <1524583836-12130-2-git-send-email-andrey.grodzovsky@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524583836-12130-2-git-send-email-andrey.grodzovsky@amd.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 25 Apr 2018 13:13:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 25 Apr 2018 13:13:52 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'oleg@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/24, Andrey Grodzovsky wrote: > > Currently calling wait_event_killable as part of exiting process > will stall forever since SIGKILL generation is suppresed by PF_EXITING. See my reply to 2/3, > In our partilaur case AMDGPU driver wants to flush all GPU jobs in > flight before shutting down. But if some job hangs the pipe we still want to > be able to kill it and avoid a process in D state. this patch won't really help in multi-threaded case, > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@ -886,10 +886,10 @@ static inline int wants_signal(int sig, struct task_struct *p) > { > if (sigismember(&p->blocked, sig)) > return 0; > - if (p->flags & PF_EXITING) > - return 0; > if (sig == SIGKILL) > return 1; > + if (p->flags & PF_EXITING) > + return 0; So you want to trigger signal_wake_up() at the end of complete_signal(). Unless you use tkill() you can wake another thread, not the thread blocked in drm_sched_entity_fini(). And if the whole process is already dying complete_signal() will do nothing else. Oleg.