Received: by 10.192.165.148 with SMTP id m20csp4920526imm; Tue, 24 Apr 2018 10:32:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx49dkPMrx2gTpC1Tglb+Hmc7Z9nfTDBIp3pzdbpEJRiOpz5VNveqFdf7YTwOuv/O1IY9Qb1B X-Received: by 10.98.79.12 with SMTP id d12mr12968103pfb.220.1524591152118; Tue, 24 Apr 2018 10:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524591152; cv=none; d=google.com; s=arc-20160816; b=Qls9YnQtyBp/bsMRIV0OwthuiJQQXu7/8UkgG857Z7q8q9TZiBAdmiB1tJUzXlQcAF KYN/adYFt7+pBIX4aMq42X4LtaXHe4ykL4lpq+J8vFRQj0Gqc7SmlWM01yuKqSXONwYx TVdPPYx212toaJOIYfAskdP+tTwY45wTS7rC8aeOj3m9TzUaV2Urrag/gdMPM57aUfhN lIwyaBKdM6CZhk3b+SFa3+DYtjcwEb2/1TUzwzhjJ7v13C/Y8xZSLKSxDw3fbkR9DuKH tdFHAvCcpRWwDzR/Z5DGedw8ZSfQ4RWli1lrEXwGub8HA7qSgwMLOTJGghq5hoxGrHsU XHhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=bhsaJ6BgKaqBSemqMZgwjs8MW8I4d86J7nKvH2ogHQY=; b=dMQ/jHaSkj72FJMmlbeVJk2y0FlXueGSy1lr8CQL9ZWxn2Y4BHiLQS9wiStRvduwbq VAvdlwbXi2y+XqRtsf54wh0pdXnaoD02F/XD2qzbDDfv2874o3j1NUSM88xp0H2FtKxJ GzDSK/8qQQ2KbIddssP8aDikJd3CrcaOdoK+GIYHzjFyPnT+SucKURby81HaD/CrrsCo jkKC31UQLjo2Xc3NxRbus8Efzgm7wvYhtWbweBR6v81bRCk87T9/U6DgT1JgLfl9AAum 10o3Yj723wLYO/sCC1jCpPwoDGWnMLGCZVIgMGonpz4OdhChx1WC8laINZa5zL2ciIny MVfQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s189si10336579pgc.571.2018.04.24.10.32.17; Tue, 24 Apr 2018 10:32:32 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751730AbeDXRbA (ORCPT + 99 others); Tue, 24 Apr 2018 13:31:00 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:34964 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750842AbeDXRa6 (ORCPT ); Tue, 24 Apr 2018 13:30:58 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fB1mL-0001Ic-Ig; Tue, 24 Apr 2018 11:30:57 -0600 Received: from [97.119.174.25] (helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fB1mK-000514-PC; Tue, 24 Apr 2018 11:30:57 -0600 From: ebiederm@xmission.com (Eric W. Biederman) 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, oleg@redhat.com, akpm@linux-foundation.org References: <1524583836-12130-1-git-send-email-andrey.grodzovsky@amd.com> <1524583836-12130-2-git-send-email-andrey.grodzovsky@amd.com> <87y3hca73s.fsf@xmission.com> Date: Tue, 24 Apr 2018 12:29:32 -0500 In-Reply-To: (Andrey Grodzovsky's message of "Tue, 24 Apr 2018 12:51:13 -0400") Message-ID: <871sf48qdf.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1fB1mK-000514-PC;;;mid=<871sf48qdf.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=97.119.174.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19N7LPTUYmHm5Y0FIwrELOcZl/CE6PfpKw= X-SA-Exim-Connect-IP: 97.119.174.25 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa04.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,XMNoVowels, XMSolicitRefs_0,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4999] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa04 1397; Body=1 Fuz1=1 Fuz2=1] * 0.1 XMSolicitRefs_0 Weightloss drug * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa04 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Andrey Grodzovsky X-Spam-Relay-Country: X-Spam-Timing: total 476 ms - load_scoreonly_sql: 0.07 (0.0%), signal_user_changed: 4.1 (0.9%), b_tie_ro: 2.7 (0.6%), parse: 1.45 (0.3%), extract_message_metadata: 17 (3.6%), get_uri_detail_list: 2.2 (0.5%), tests_pri_-1000: 8 (1.6%), tests_pri_-950: 1.72 (0.4%), tests_pri_-900: 1.45 (0.3%), tests_pri_-400: 25 (5.2%), check_bayes: 23 (4.9%), b_tokenize: 8 (1.8%), b_tok_get_all: 6 (1.3%), b_comp_prob: 2.7 (0.6%), b_tok_touch_all: 2.3 (0.5%), b_finish: 0.73 (0.2%), tests_pri_0: 153 (32.2%), check_dkim_signature: 0.57 (0.1%), check_dkim_adsp: 4.5 (0.9%), tests_pri_500: 260 (54.6%), poll_dns_idle: 251 (52.6%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 1/3] signals: Allow generation of SIGKILL to exiting task. X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrey Grodzovsky writes: > On 04/24/2018 12:42 PM, Eric W. Biederman wrote: >> Andrey Grodzovsky writes: >> >>> Currently calling wait_event_killable as part of exiting process >>> will stall forever since SIGKILL generation is suppresed by PF_EXITING. >>> >>> 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. >> I should clarify. This absolutely can not be done. >> PF_EXITING is set just before a task starts tearing down it's signal >> handling. >> >> So delivering any signal, or otherwise depending on signal handling >> after PF_EXITING is set can not be done. That abstraction is gone. > > I see, so you suggest it's the driver responsibility to avoid creating > such code path that ends up > calling wait_event_killable from exit call stack (PF_EXITING == 1) ? I don't just suggest. I am saying clearly that any dependency on receiving SIGKILL after PF_EXITING is set is a bug. It looks safe (the bitmap is not freed) to use wait_event_killable on a dual use code path, but you can't expect SIGKILL ever to be delivered during fop->release, as f_op->release is called from exit after signal handling has been shutdown. The best generic code could do would be to always have fatal_signal_pending return true after PF_EXITING is set. Increasingly I am thinking that drm_sched_entity_fini should have a wait_event_timeout or no wait at all. The cleanup code should have a progress guarantee of it's own. Eric