From patchwork Wed May 1 19:48:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Zhou X-Patchwork-Id: 10925539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB9731515 for ; Wed, 1 May 2019 19:48:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBB1E28CD5 for ; Wed, 1 May 2019 19:48:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFBE428E36; Wed, 1 May 2019 19:48:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F56628CD5 for ; Wed, 1 May 2019 19:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726175AbfEATso (ORCPT ); Wed, 1 May 2019 15:48:44 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44349 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726004AbfEATso (ORCPT ); Wed, 1 May 2019 15:48:44 -0400 Received: by mail-pf1-f195.google.com with SMTP id y13so9042513pfm.11 for ; Wed, 01 May 2019 12:48:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+pgdi1eNTsVXzNKyAIZD/a8iRJDidh8BfAlY25QI4xI=; b=kBy49VeaIzq419BSFaq+KXKEb8oLu8DFahM0d06ZBJ4HQ10ne8ZQi+RkLRipwkTUHJ FuvIgVMDY/uhfDoFXSPO5yPlm83ZDbE2AtjO3eh/vzkRgvIocYejEeZFU+al8NJeVmMd PyHNeaD9evUIbvw6OifMjNi8jG/DGj6lyFuW3f6RcdTfOZWmDaF+AGO49SONl2spYK6H cy4ge/+kI3vD0HaMJtbHprhTgSjTRhzmzoxVsm1qsFDEPYTOwEuxnl5k0B6uZNikl7H8 NshyCWxWOKEYQXSIURltlEtUvJS/9uwsoVcYHP9LgXIkywOrUdySnEFh2k+/y+P1Sk0h qpgQ== X-Gm-Message-State: APjAAAVGMz0tOoHVrw6Bm2PxoeFjrN3n3qT7Ne17Lt3f3aXWAthloUZh lPYaVpacJ/4nrsa6uowd/6jvwNqIMiI= X-Google-Smtp-Source: APXvYqzxE39ZJuApeahw3giDfga4AD4JCB+TV9hW7UXy+Ny/JzITWfifF6KEF8RWcntR1nb4RiR6QA== X-Received: by 2002:a63:2cc9:: with SMTP id s192mr23835934pgs.24.1556740123768; Wed, 01 May 2019 12:48:43 -0700 (PDT) Received: from dennisz-mbp.thefacebook.com ([199.201.64.2]) by smtp.gmail.com with ESMTPSA id b2sm43701414pff.63.2019.05.01.12.48.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 May 2019 12:48:42 -0700 (PDT) From: Dennis Zhou To: Omar Sandoval Cc: kernel-team@fb.com, linux-block@vger.kernel.org, Dennis Zhou Subject: [PATCH v2] block: fix fio jobs for 027 and add cgroup support Date: Wed, 1 May 2019 15:48:38 -0400 Message-Id: <20190501194838.81646-1-dennis@kernel.org> X-Mailer: git-send-email 2.13.5 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Previously, the test was broken as "$fio_jobs" was considered as a string instead of additional parameters. This is fixed here. Second, there was an issue with earlier kernels when request lists existed such that request_queues were never being cleaned up because non-root blkgs took a reference on the queue. However, blkgs were being cleaned up after the last reference to the request_queue was put back. This creates a blktest cgroup for the fio jobs to utilize and should be useful for catching this scenario in the future. Signed-off-by: Dennis Zhou --- tests/block/027 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/block/027 b/tests/block/027 index b480016..ae464dd 100755 --- a/tests/block/027 +++ b/tests/block/027 @@ -26,6 +26,13 @@ scsi_debug_stress_remove() { return fi + _init_cgroup2 + + # setup cgroups + echo "+io" > "/sys/fs/cgroup/cgroup.subtree_control" + echo "+io" > "$CGROUP2_DIR/cgroup.subtree_control" + mkdir -p "$CGROUP2_DIR/${TEST_NAME}" + # set higher aio limit echo 524288 > /proc/sys/fs/aio-max-nr @@ -45,13 +52,13 @@ scsi_debug_stress_remove() { ((cnt++)) done - local num_jobs=4 runtime=21 + local num_jobs=4 runtime=12 fio --rw=randread --size=128G --direct=1 --ioengine=libaio \ --iodepth=2048 --numjobs=$num_jobs --bs=4k \ --group_reporting=1 --group_reporting=1 --runtime=$runtime \ - --loops=10000 "$fio_jobs" > "$FULL" 2>&1 & + --loops=10000 --cgroup=blktests/${TEST_NAME} $fio_jobs > "$FULL" 2>&1 & - sleep 7 + sleep 6 local device_path for dev in "${SCSI_DEBUG_DEVICES[@]}"; do # shutdown devices in progress @@ -61,6 +68,10 @@ scsi_debug_stress_remove() { wait + sleep 5 + + _exit_cgroup2 + _exit_scsi_debug }