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 49247C433F5 for ; Mon, 18 Apr 2022 18:08:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234140AbiDRSLL (ORCPT ); Mon, 18 Apr 2022 14:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237634AbiDRSLK (ORCPT ); Mon, 18 Apr 2022 14:11:10 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5FFEF369FD for ; Mon, 18 Apr 2022 11:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650305309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WdXM/O4XLpmVidBtJkAy05fgtcPhsOW7ivbARwQBA4M=; b=KW9lufDK+uIflXzJj2F3akmavmk51cU/Okgmx+qnBdqbIfYD/KuhhzIaASoMLwosgho6Jp lFFUgvpRTSyBraoxoxnOPKLg+m4C7tToqwjZO0ZEIxZ9DFjLOGodsvYtKlDaSVXMVBJYvb 3Mv8FaXCRaShH65DV1eAuTQAGLPTOl8= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-468-JBp5cjSAN4aWmEVDJCgNeg-1; Mon, 18 Apr 2022 14:08:28 -0400 X-MC-Unique: JBp5cjSAN4aWmEVDJCgNeg-1 Received: by mail-qk1-f199.google.com with SMTP id q5-20020a05620a0d8500b004738c1b48beso10868060qkl.7 for ; Mon, 18 Apr 2022 11:08:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=WdXM/O4XLpmVidBtJkAy05fgtcPhsOW7ivbARwQBA4M=; b=c46HWKguXLxbNwm9rq0jSVHAAfrmqge6HxC2BeTKj2jbuSeaNArhpwWq/xruE0C5Ar NnZYM3dunGCe0FNlC1G7YUnTIIVwBH2/M9yxjXnnxOML/DaoYoOJtfx/raEDefPIM4Uj 2mhKufglRnA1lingxDh7OPcJpUQPjL/pLI3Yz47YlN60iVYkWMGyDJrXLpOcoWfDLGen hbuwg40Ie2Cz8P0ENw5H8HOVb+iPrJt1UojloCkro/98og73UD2q17LYwvWP8WeybWQ1 SRrAvW+lXd25xUjvbI5rq/GzqoIlUoFciG89GxaFdFg47VnjEufvIvoFrWmq3Xj4XEfG SW+A== X-Gm-Message-State: AOAM5308HpbQNl/zjW9/mGeY25x6IO/czOYGKrEcDC9qa1MEjJ0aEGi9 QTOWNy6ZDnfPz2J7M5PH+y4yQ2QUtdQ4brBq0uyc6sWGupQjceVuhhgy1UB9wOScxvUoJbIr8Se LRgcuxtM7aCcWEMXgTA== X-Received: by 2002:a05:6214:1c8f:b0:443:8505:14b3 with SMTP id ib15-20020a0562141c8f00b00443850514b3mr9178322qvb.7.1650305307497; Mon, 18 Apr 2022 11:08:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx12jt4/LACs4ATGUifHtktZDF90NZHhv1L+new5HYSeCJsz1jGAY4jyTwR4a0R8ZyO8ytdDQ== X-Received: by 2002:a05:6214:1c8f:b0:443:8505:14b3 with SMTP id ib15-20020a0562141c8f00b00443850514b3mr9178306qvb.7.1650305307274; Mon, 18 Apr 2022 11:08:27 -0700 (PDT) Received: from zlang-mailbox ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id a5-20020ac85b85000000b002f1e37f1df5sm7607774qta.21.2022.04.18.11.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 11:08:26 -0700 (PDT) Date: Tue, 19 Apr 2022 02:08:21 +0800 From: Zorro Lang To: "Darrick J. Wong" Cc: fstests Subject: Re: [PATCH] generic/019: kill background processes on interrupt Message-ID: <20220418180821.cd7flysbpdy7jhvy@zlang-mailbox> Mail-Followup-To: "Darrick J. Wong" , fstests References: <20220411054833.2157779-1-david@fromorbit.com> <20220412145942.0a268875@suse.de> <20220412142500.ubkbw2fvbxowzo5p@zlang-mailbox> <20220413002656.GL1609613@dread.disaster.area> <20220414162544.kiesx5muc5ddtbzd@zlang-mailbox> <20220414191643.5udsx6kdarlumyfn@zlang-mailbox> <20220416141126.wwzvkzyzbvjczfae@zlang-mailbox> <20220418170737.GE17014@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220418170737.GE17014@magnolia> Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org On Mon, Apr 18, 2022 at 10:07:37AM -0700, Darrick J. Wong wrote: > On Sat, Apr 16, 2022 at 08:13:59PM +0300, Amir Goldstein wrote: > > On Sat, Apr 16, 2022 at 5:11 PM Zorro Lang wrote: > > > > > > On Sat, Apr 16, 2022 at 12:20:22PM +0300, Amir Goldstein wrote: > > > > On Fri, Apr 15, 2022 at 12:56 PM Zorro Lang wrote: > > > > > > > > > > On Fri, Apr 15, 2022 at 12:25:44AM +0800, Zorro Lang wrote: > > > > > > On Wed, Apr 13, 2022 at 10:26:56AM +1000, Dave Chinner wrote: > > > > > > > On Tue, Apr 12, 2022 at 10:25:00PM +0800, Zorro Lang wrote: > > > > > > > > On Tue, Apr 12, 2022 at 02:59:42PM +0200, David Disseldorp wrote: > > > > > > > > > On Mon, 11 Apr 2022 15:48:33 +1000, Dave Chinner wrote: > > > > > > > > > > > > > > > > > > > From: Dave Chinner > > > > > > > > > > > > > > > > > > > > If you ctrl-c generic/019, it leaves fsstress processes running. > > > > > > > > > > Kill them in the cleanup function so that they don't have to be > > > > > > > > > > manually killed after interrupting the test. > > > > > > > > > > > > > > > > > > > > While touching the _cleanup() function, make it do everything that > > > > > > > > > > the generic _cleanup function it overrides does and fix the > > > > > > > > > > indenting. > > > > > > > > > > > > > > > > > > > > Signed-off-by: Dave Chinner > > > > > > > > > > --- > > > > > > > > > > tests/generic/019 | 6 ++++-- > > > > > > > > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > > > > > > > diff --git a/tests/generic/019 b/tests/generic/019 > > > > > > > > > > index db56dac1..cda107f4 100755 > > > > > > > > > > --- a/tests/generic/019 > > > > > > > > > > +++ b/tests/generic/019 > > > > > > > > > > @@ -53,8 +53,10 @@ stop_fail_scratch_dev() > > > > > > > > > > # Override the default cleanup function. > > > > > > > > > > _cleanup() > > > > > > > > > > { > > > > > > > > > > - disallow_fail_make_request > > > > > > > > > > - rm -f $tmp.* > > > > > > > > > > + kill $fs_pid $fio_pid &> /dev/null > > > > > > > > > > + disallow_fail_make_request > > > > > > > > > > + cd / > > > > > > > > > > + rm -r -f $tmp.* > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > RUN_TIME=$((20+10*$TIME_FACTOR)) > > > > > > > > > > > > > > > > > > Might be worth unset'ing the "fs_pid" and "fio_pid" variables after the > > > > > > > > > wait, but should be fine as-is: > > > > > > > > > > > > > > > > I agree. Better to avoid killing other system processes. Or how about this place > > > > > > > > does (avoid killing system useful processes): > > > > > > > > $KILLALL_PROG -q $FSSTRESS_PROG > > > > > > > > $KILLALL_PROG -q $FIO_PROG > > > > > > > > > > > > > > > > Another picky question is, do we need to use a while loop checking, until the > > > > > > > > processes really get killed? :) > > > > > > > > > > > > > > Do we really need to paint the bikeshed over how best to kill a > > > > > > > process? I don't have time to do that, this is just a drive-by fix > > > > > > > that works for me.... > > > > > > > > > > > > Sure Dave:) The while loop checking is a little picky, I just ask what do you think, no > > > > > > objection if you don't like that. Due to quick cleanup and exit is a good reason too. > > > > > > > > > > > > I think it might be worth doing "$KILLALL_PROG -q $FSSTRESS_PROG $FIO_PROG" at least, to > > > > > > avoid killing other processes might be useful. > > > > > > > > That has much more likelihood to kill processes not spawn by the test > > > > then pid wraparound. > > > > > > Yes, you're right. But generally we don't run xfstests with other testing, to avoid other > > > testing break dmesg checking of xfstests. (Is there a way to help different process get > > > independent dmesg out? If there's, I'm very glad to know how to do that, then I can run > > > xfstests concurrently in one system:) > > > > > > Anyway, we can choose another way -- "unset'ing the "fs_pid" and "fio_pid" variables > > > after the wait", both are fine to me. > > > > > > > Fine by me > > The change to clear the fs_pid/fio_pid variables was not correct and now > causes generic/019 to fail. I'll send a patch shortly. Yeah, it shouldn't be: unset $fs_pid unset $fio_pid The "$" should be removed. > > --D > > > Thanks, > > Amir. >