Received: by 10.192.165.148 with SMTP id m20csp3944099imm; Mon, 30 Apr 2018 09:01:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZode7ujypkWVRpoBzZQg/LcluMmpc6/mU7M7IeTZ0vVvLNIx1mWZSiDchkpi+bnez9L/NNq X-Received: by 2002:a63:a74b:: with SMTP id w11-v6mr10406843pgo.351.1525104062851; Mon, 30 Apr 2018 09:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525104062; cv=none; d=google.com; s=arc-20160816; b=m4p2kHS8pm8oYJCy99Fad8Q3vAh7HPkZYDmfYZNAy/1cIgXrSsVv2SWW2BJNDyuTyO kdLY7O+iTgcXG1CvgCKVBcIyDOmQ6N4D2T6odeXYCRHoEYmk5PXjcnuO7+AI0Mn/iHg5 5fQ74DBOuYUiFUbz7tPCMXdOG4t6ZDh8QJrdav1r/ZncEWaj4qhNuZTBhu9pUoU6+Jxu iS32V8OiOYRYRXVSGijecrRA92VV4sMboj6+/APsuJTY9xIRiFuKI1YEnWvpEmesLwIW XESRsPLYyM0KL76V9jUmGwPOHqWbdsBTIcPrgr/e4vbRfGRhB3K3K2B01vgjQg2pz8z/ mdLg== 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:message-id:subject:cc:to:from:date :arc-authentication-results; bh=47VTrrNVUKdDd66Q5l5MAwlXknI8ggC07bJD4M7tnmI=; b=xIT8fEUGW/qfNuErD73jcqbwNFf530oafd7pGdILn4YSmQ+xpwgvfr71HQsY7Ba1gM qTT6A3NcPjYtmMQC/qmsy26b9Xqdf4cav5mdcb50EvXzX5P4WTB+5nNyq/dAoVdeByKw YpKKQzvRYzUkMCBqfb8vhk2/7MgA7HOcanBqB/yqFerEqoKWbIcAz4mImvHuPgh1Lbcc JtJSymzV99QM3fl6vesY0B2mYUuMrC193o3Ws3xuId8SIWG6OSKYiRERdDLfuQrJC4OR JCTMFf4tZSYtK+7hwojBtT+cWnT2IwH0ezvagqeeQaXr+RG8Gh6JZfE+8m1HIvRnEGSX i5Jg== 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 s11-v6si6294157pgn.403.2018.04.30.09.00.48; Mon, 30 Apr 2018 09:01: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; 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 S1754812AbeD3QAK (ORCPT + 99 others); Mon, 30 Apr 2018 12:00:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53522 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754474AbeD3QAJ (ORCPT ); Mon, 30 Apr 2018 12:00:09 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BFC7A81A8C1C; Mon, 30 Apr 2018 16:00:08 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.34.27.30]) by smtp.corp.redhat.com (Postfix) with SMTP id 8466F215CDA7; Mon, 30 Apr 2018 16:00:07 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 30 Apr 2018 18:00:08 +0200 (CEST) Date: Mon, 30 Apr 2018 18:00:06 +0200 From: Oleg Nesterov To: Andrey Grodzovsky Cc: christian.koenig@amd.com, "Eric W. Biederman" , David.Panariti@amd.com, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Alexander.Deucher@amd.com, akpm@linux-foundation.org Subject: Re: [PATCH 2/3] drm/scheduler: Don't call wait_event_killable for signaled process. Message-ID: <20180430160006.GB10583@redhat.com> References: <87muxsbmkp.fsf@xmission.com> <8840ac96-50c4-f94d-eb7c-f007940163f3@amd.com> <877eowa5qh.fsf@xmission.com> <20180425135552.GD7592@redhat.com> <20180425171757.GA10441@redhat.com> <874ljyu98e.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 30 Apr 2018 16:00:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 30 Apr 2018 16:00:08 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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/30, Andrey Grodzovsky wrote: > > What about changing PF_SIGNALED to? PF_EXITING in > drm_sched_entity_do_release > > -?????? if ((current->flags & PF_SIGNALED) && current->exit_code == SIGKILL) > +????? if ((current->flags & PF_EXITING) && current->exit_code == SIGKILL) let me repeat, please don't use task->exit_code. And in fact this check is racy. But this doesn't matter. Say, we can trivially add SIGNAL_GROUP_KILLED_BY_SIGKILL, or do something else, but I fail to understand what are you trying to do. Suppose that the check above is correct in that it is true iff the task is exiting and it was killed by SIGKILL. What about the "else" branch which does r = wait_event_killable(sched->job_scheduled, ...) ? Once again, fatal_signal_pending() (or even signal_pending()) is not well defined after the exiting task passes exit_signals(). So wait_event_killable() can fail because fatal_signal_pending() is true; and this can happen even if it was not killed. Or it can block and SIGKILL won't be able to wake it up. > If SIGINT was sent then it's SIGINT, Yes, but see above. in this case fatal_signal_pending() will be likely true so wait_event_killable() will fail unless condition is already true. Oleg.