From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756291AbdELDtJ (ORCPT ); Thu, 11 May 2017 23:49:09 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:49475 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752146AbdELDtI (ORCPT ); Thu, 11 May 2017 23:49:08 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Guenter Roeck Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Vovo Yang References: <20170511171108.GB15063@roeck-us.net> <87shkbfggm.fsf@xmission.com> <20170511202104.GA14720@roeck-us.net> <87y3u3axx8.fsf@xmission.com> <20170511224724.GB15676@roeck-us.net> Date: Thu, 11 May 2017 22:42:39 -0500 In-Reply-To: <20170511224724.GB15676@roeck-us.net> (Guenter Roeck's message of "Thu, 11 May 2017 15:47:24 -0700") Message-ID: <871sru91w0.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=1d91Zd-0007xO-Eh;;;mid=<871sru91w0.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.121.81.159;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+t2JeIBGv+p4+JdxzbDn9ZWhhrfGQ/wk4= 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 * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -3.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0013] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.1 XMSolicitRefs_0 Weightloss drug X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Guenter Roeck X-Spam-Relay-Country: X-Spam-Timing: total 5302 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.7 (0.1%), b_tie_ro: 1.93 (0.0%), parse: 0.99 (0.0%), extract_message_metadata: 12 (0.2%), get_uri_detail_list: 1.18 (0.0%), tests_pri_-1000: 4.7 (0.1%), tests_pri_-950: 1.17 (0.0%), tests_pri_-900: 0.95 (0.0%), tests_pri_-400: 14 (0.3%), check_bayes: 13 (0.3%), b_tokenize: 4.3 (0.1%), b_tok_get_all: 4.0 (0.1%), b_comp_prob: 1.41 (0.0%), b_tok_touch_all: 2.1 (0.0%), b_finish: 0.65 (0.0%), tests_pri_0: 98 (1.9%), check_dkim_signature: 0.46 (0.0%), check_dkim_adsp: 2.8 (0.1%), tests_pri_500: 5163 (97.4%), poll_dns_idle: 5156 (97.2%), rewrite_mail: 0.00 (0.0%) Subject: Re: Threads stuck 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 Guenter Roeck writes: > On Thu, May 11, 2017 at 04:25:23PM -0500, Eric W. Biederman wrote: >> Guenter Roeck writes: >> > As an add-on to my previous mail: I added a function to count >> > the number of threads in the pid namespace, using next_pidmap(). >> > Even though nr_hashed == 2, only the hanging thread is still >> > present. >> >> For your testcase? I suspect you copied the code from >> zap_pid_ns_processes and skipped pid 1. It is going to be pid 1 that is >> calling zap_pid_ns_processes. >> > > Almost. Something along the line of > > count = 0; > nr = next_pidmap(pid_ns, 0); > while (nr > 0) { > count++; > nr = next_pidmap(pid_ns, nr); > } > > only I also call sched_show_task() for each thread, and the only > one printed is the one that hangs in zap_pid_ns_processes(). The function sched_show_task() does: if (!try_get_task_stack(p)) return; Which won't work on a zombie who has already released it's stack. Which is exactly what child2 should be at that point. Eric