From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5799C433EF for ; Tue, 19 Jul 2022 08:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235897AbiGSIcj (ORCPT ); Tue, 19 Jul 2022 04:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbiGSIch (ORCPT ); Tue, 19 Jul 2022 04:32:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D882C220D1; Tue, 19 Jul 2022 01:32:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 91E3DB81893; Tue, 19 Jul 2022 08:32:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB0F3C341C6; Tue, 19 Jul 2022 08:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658219554; bh=pplzxYz6sIF7Mjy2044C1CiT3gW+EWOdS76ev7aFkFE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FwKxrFSVQL3hlswBw4lRRBHWH90KbD1z2uO1coRHKpavqBkt+9nh3n0GtVERzfPc6 2orAVr7dY8eJGmGWVSVuCLTk6Ot/5ycingm10rYQGCNOgGe7Wpv9VH8fBDB+l+jG+p evypO8rjE60vG4OhVd9PuZOD1lpv5dT2Q9YeCVwLkEOfgfN1/objmmgwMMxJHifuOc cBNIs743ctJu0UmjVd8O1EnHTemThPNu6vD6imLNjUdzY0AZdlAVMJDyx9rpMtzsGl aQQhwgSRaFCIdUVpipsARyiuYboLM1lfvOZG0up8ex3fHmgEDquXiHFdMgzKbFqhp7 W2NK4/VcUFMNQ== Date: Tue, 19 Jul 2022 10:32:29 +0200 From: Christian Brauner To: "lizhijian@fujitsu.com" Cc: Shuah Khan , "linux-kernel@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , Philip Li , kernel test robot Subject: Re: [PATCH] ksefltest: pidfd: Fix wait_states: Test terminated by timeout Message-ID: <20220719083229.b2yn2msrklmo2nb5@wittgenstein> References: <20220718025826.29148-1-lizhijian@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220718025826.29148-1-lizhijian@fujitsu.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 18, 2022 at 02:58:39AM +0000, lizhijian@fujitsu.com wrote: > 0Day/LKP observed that the kselftest blocks forever since one of the > pidfd_wait doesn't terminate in 1 of 30 runs. After digging into > the source, we found that it blocks at: > ASSERT_EQ(sys_waitid(P_PIDFD, pidfd, &info, WCONTINUED, NULL), 0); > > wait_states has below testing flow: > CHILD PARENT > ---------------+-------------- > 1 STOP itself > 2 WAIT for CHILD STOPPED > 3 SIGNAL CHILD to CONT > 4 CONT > 5 STOP itself > 5' WAIT for CHILD CONT > 6 WAIT for CHILD STOPPED > > The problem is that the kernel cannot ensure the order of 5 and 5', once > 5's goes first, the test will fail. > > we can reproduce it by: > $ while true; do make run_tests -C pidfd; done > > Introduce a blocking read in child process to make sure the parent can > check its WCONTINUED. > > CC: Philip Li > Reported-by: kernel test robot > Signed-off-by: Li Zhijian > --- > I have almost forgotten this patch since the former version post over 6 months > ago. This time I just do a rebase and update the comments. > V2: rewrite with pipe to avoid usleep > --- Thanks for sticking with this! Reviewed-by: Christian Brauner (Microsoft)