From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758456AbdELSBy (ORCPT ); Fri, 12 May 2017 14:01:54 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:60929 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756046AbdELSBw (ORCPT ); Fri, 12 May 2017 14:01:52 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Guenter Roeck Cc: Vovo Yang , Ingo Molnar , linux-kernel@vger.kernel.org, Linux Containers References: <20170511171108.GB15063@roeck-us.net> <87shkbfggm.fsf@xmission.com> <20170511202104.GA14720@roeck-us.net> <87y3u3axx8.fsf@xmission.com> <20170511224724.GB15676@roeck-us.net> <8760h79e22.fsf@xmission.com> <8760h66wak.fsf@xmission.com> <20170512165214.GA12960@roeck-us.net> <874lwqyo8i.fsf@xmission.com> Date: Fri, 12 May 2017 12:55:22 -0500 In-Reply-To: <874lwqyo8i.fsf@xmission.com> (Eric W. Biederman's message of "Fri, 12 May 2017 12:33:01 -0500") Message-ID: <87d1bex8mt.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=1d9Esq-00065R-Sm;;;mid=<87d1bex8mt.fsf_-_@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.121.81.159;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18mUSyC59UupNCKmDHYLJ2tolZVwoFvxj8= X-SA-Exim-Connect-IP: 97.121.81.159 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.5 XMGappySubj_01 Very gappy subject * 1.5 TR_Symld_Words too many words that have symbols inside * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 BAYES_40 BODY: Bayes spam probability is 20 to 40% * [score: 0.3376] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Guenter Roeck X-Spam-Relay-Country: X-Spam-Timing: total 5682 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.4 (0.0%), b_tie_ro: 1.61 (0.0%), parse: 0.88 (0.0%), extract_message_metadata: 15 (0.3%), get_uri_detail_list: 1.73 (0.0%), tests_pri_-1000: 8 (0.1%), tests_pri_-950: 1.19 (0.0%), tests_pri_-900: 0.97 (0.0%), tests_pri_-400: 18 (0.3%), check_bayes: 17 (0.3%), b_tokenize: 6 (0.1%), b_tok_get_all: 5 (0.1%), b_comp_prob: 1.79 (0.0%), b_tok_touch_all: 2.6 (0.0%), b_finish: 0.59 (0.0%), tests_pri_0: 148 (2.6%), check_dkim_signature: 0.45 (0.0%), check_dkim_adsp: 2.9 (0.1%), tests_pri_500: 5484 (96.5%), poll_dns_idle: 5478 (96.4%), rewrite_mail: 0.00 (0.0%) Subject: [REVIEW][PATCH] pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes 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 in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Date: Thu, 11 May 2017 18:21:01 -0500 The code can potentially sleep for an indefinite amount of time in zap_pid_ns_processes triggering the hung task timeout, and increasing the system average. This is undesirable. Sleep with a task state of TASK_INTERRUPTIBLE instead of TASK_UNINTERRUPTIBLE to remove these undesirable side effects. Apparently under heavy load this has been allowing Chrome to trigger the hung time task timeout error and cause ChromeOS to reboot. Reported-by: Vovo Yang Reported-by: Guenter Roeck Fixes: 6347e9009104 ("pidns: guarantee that the pidns init will be the last pidns process reaped") Cc: stable@vger.kernel.org Signed-off-by: "Eric W. Biederman" --- This is what I have queued up posting so it is public knowledge and so that if anyone can see a flaw it can get fixed. kernel/pid_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index de461aa0bf9a..6e51b8820495 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -277,7 +277,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) * if reparented. */ for (;;) { - set_current_state(TASK_UNINTERRUPTIBLE); + set_current_state(TASK_INTERRUPTIBLE); if (pid_ns->nr_hashed == init_pids) break; schedule(); -- 2.10.1