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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EF4FC27C75 for ; Wed, 12 Jun 2024 08:01:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E514C6B0193; Wed, 12 Jun 2024 04:01:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DDA456B0194; Wed, 12 Jun 2024 04:01:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C542B6B0195; Wed, 12 Jun 2024 04:01:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A3D4F6B0193 for ; Wed, 12 Jun 2024 04:01:05 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 518141614B0 for ; Wed, 12 Jun 2024 08:01:05 +0000 (UTC) X-FDA: 82221490890.28.287F99F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf22.hostedemail.com (Postfix) with ESMTP id F3A09C0014 for ; Wed, 12 Jun 2024 08:01:02 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=f8TGI6w4; spf=pass (imf22.hostedemail.com: domain of zlang@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=zlang@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718179263; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=p/SC79B0SQx0Kv68DpQnR4beG6Hiq5QD/FW1/evjIEo=; b=IzJQ3QddYz1cD7UTVxr6eprtHzJbQQSapUWJJ22gt6tWa480KuIJtN+Nm3tm/YTTCn3XLL eMe9w2fT38dQY+C8aUy7IExUZ94G4EozAmIMNV49Bwd4rPnr7HGufthnS/XcNeG8DBM1RV d52lY195q3gduAhfypqWJ17nqeG4g4I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718179263; a=rsa-sha256; cv=none; b=x2nA8RtVd4Hbr5OuU1xLfodU+XPmA64Czy98Us1cVyui0I0skVQszWyW4kjnlhjbjNJQsn sOzHig/OTn2wmXwH9DE6yW8SB1OoC4cVPk81sNw5O5Uw9uucGSBD+l89xJiO1WZUpbk8q5 /WeUVpOkDrO0/RM1em8iK0KgDszw3zI= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=f8TGI6w4; spf=pass (imf22.hostedemail.com: domain of zlang@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=zlang@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718179262; 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=p/SC79B0SQx0Kv68DpQnR4beG6Hiq5QD/FW1/evjIEo=; b=f8TGI6w4MQlwKXWaOYnN7/zFWw9JpM3b81iram46bC32cshZ/fO61Gwb1RxGbV+WNYa93U LU0WbxJ7RWUdCD1Z0pb4UFkiQw//xxdGIjWfoqlg3izUEWQ9KarYTfaOBVSN1aZI1leOeK GwgBVRd0dADocVFkMMUvNwG8Wa8zUlU= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-169-m1srEXfUNGiH73Ti9VgnLg-1; Wed, 12 Jun 2024 04:00:58 -0400 X-MC-Unique: m1srEXfUNGiH73Ti9VgnLg-1 Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-6f18f1ec8d8so2310022a12.3 for ; Wed, 12 Jun 2024 01:00:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718179257; x=1718784057; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=p/SC79B0SQx0Kv68DpQnR4beG6Hiq5QD/FW1/evjIEo=; b=uHyWJAnj261hFxKnDSzo7hs/109xHnZsjsOTBGkptK+NZNk+r6uHsxdyuweKRs8aLa jVax5x7h5ZXtL1mDT172hZronniSNgEqCBFp3bUrg5wpHr0kOmmBQPFpnkaPovxKsTT+ 4caO37b0DWeZEyaZBADOJKFHguNfAjd8tw20+Iav+sChuqmVmVyp5fX8c+Iqopz5BWiR 59KhlhNV4/yZIGhUqPYmqP1Klo8scegxv2RUzxFDMFWdK9Yxw/P9sAnMAHs63kXjvco5 SAnStKYTiDY4MEzLO/dlR0+ElfpoNzY9SMkSZVAlguZqlhswAHCBfysObHf1C9BBfA18 fMqA== X-Forwarded-Encrypted: i=1; AJvYcCXdrLYB0fo+DXEbd4wHtQu1A760XN6WKz5ZYE5s4VF2nreG9m9fuOU6dvk80bPRILAC5t1Tmr/m7x2H8o1tQrq+6CI= X-Gm-Message-State: AOJu0YzQi2NmzkbepGXWIjBLozAmqmOupPXUs4/SbyV1h/RJ+qP9wNPc U42PjKFPttPnm0pdbPHIQPX1lwAUGNWxO6bS97Kh404IA1EKtXwaKgmbntcBPepg/IXbOpPLAqP 6bNH5IPajDXzNy+ivQU0R04iHDYMm58MvtB7hRE/w0smb19pZ X-Received: by 2002:a05:6a20:8423:b0:1b8:7df1:595b with SMTP id adf61e73a8af0-1b8a9ba7d01mr1293389637.21.1718179256880; Wed, 12 Jun 2024 01:00:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAPrr/MJx8mrt70uE7M9aB9/SWIUme1NLj1rWoKuRef2sjVdMtlSpkqcr6UXpxn4s/+VwzgQ== X-Received: by 2002:a05:6a20:8423:b0:1b8:7df1:595b with SMTP id adf61e73a8af0-1b8a9ba7d01mr1293331637.21.1718179256174; Wed, 12 Jun 2024 01:00:56 -0700 (PDT) Received: from dell-per750-06-vm-08.rhts.eng.pek2.redhat.com ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705a16c7803sm4123812b3a.144.2024.06.12.01.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:00:55 -0700 (PDT) Date: Wed, 12 Jun 2024 16:00:48 +0800 From: Zorro Lang To: Luis Chamberlain Cc: patches@lists.linux.dev, fstests@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, ziy@nvidia.com, vbabka@suse.cz, seanjc@google.com, willy@infradead.org, david@redhat.com, hughd@google.com, linmiaohe@huawei.com, muchun.song@linux.dev, osalvador@suse.de, p.raghav@samsung.com, da.gomez@samsung.com, hare@suse.de, john.g.garry@oracle.com Subject: Re: [PATCH 3/5] fstests: add fsstress + compaction test Message-ID: <20240612080048.dnbc3rzmeo7jtubv@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com> References: <20240611030203.1719072-1-mcgrof@kernel.org> <20240611030203.1719072-4-mcgrof@kernel.org> MIME-Version: 1.0 In-Reply-To: <20240611030203.1719072-4-mcgrof@kernel.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Server: rspam03 X-Stat-Signature: qx13zwh4p1n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fMGKQxW96CsyoegBOYOcCezR/AS9tqTelhdKt55KvxtezVm0uMTPVPk6FBWzM/PEEzZ2GrelTIhwcVJ3g0s1KKulnCRJidL2/F3mHxBEjCmpn6Bmq5/fc15DVY2ipI3izmVjjyuL7hEZUC4F6ln5lEzQpQlPMqp4MD3N8tj+jErHX0LRWnEnhyfUjbuIZ60rAzQP2dDeHAV3rKFrN2u0/7onpo6c+5JTm8nW95ugCKBrArZJcYjPNzuioDdTjph9lYzkuTAMi7eU8mImq55Gza9AH4TEve/kUWTvS+cEvC15uhN/FIRETNEG2BiNGD+tfDglTY5wEIeJUyOulUUEY6meYqEy7TKu20LjWL8wkx0axt1JGvuWMCpNpni0yVTHrlENBbBGUZFDJ3Fzj9JeH7kAj9OAr3m7UN95ro7egMAbUXY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, Jun 10, 2024 at 08:02:00PM -0700, Luis Chamberlain wrote: > Running compaction while we run fsstress can crash older kernels as per > korg#218227 [0], the fix for that [0] has been posted [1] that patch > was merged on v6.9-rc6 fixed by commit d99e3140a4d3 ("mm: turn > folio_test_hugetlb into a PageType"). However even on v6.10-rc2 where > this kernel commit is already merged we can still deadlock when running > fsstress and at the same time triggering compaction, this is a new > issue being reported now this through patch, but this patch also > serves as a reproducer with a high confidence. It always deadlocks. > If you enable CONFIG_PROVE_LOCKING with the defaults you will end up > with a complaint about increasing MAX_LOCKDEP_CHAIN_HLOCKS [1], if > you adjust that you then end up with a few soft lockup complaints and > some possible deadlock candidates to evaluate [2]. > > Provide a simple reproducer and pave the way so we keep on testing this. > > Without lockdep enabled we silently deadlock on the first run of the > test without the fix applied. With lockdep enabled you get a splat about > the possible deadlock on the first run of the test. > > [0] https://bugzilla.kernel.org/show_bug.cgi?id=218227 > [1] https://gist.github.com/mcgrof/824913b645892214effeb1631df75072 > [2] https://gist.github.com/mcgrof/926e183d21c5c4c55d74ec90197bd77a > > Signed-off-by: Luis Chamberlain > --- > common/rc | 7 +++++ > tests/generic/750 | 62 +++++++++++++++++++++++++++++++++++++++++++ > tests/generic/750.out | 2 ++ > 3 files changed, 71 insertions(+) > create mode 100755 tests/generic/750 > create mode 100644 tests/generic/750.out > > diff --git a/common/rc b/common/rc > index e812a2f7cc67..18ad25662d5c 100644 > --- a/common/rc > +++ b/common/rc > @@ -151,6 +151,13 @@ _require_hugepages() > _notrun "Kernel does not report huge page size" > } > > +# Requires CONFIG_COMPACTION > +_require_vm_compaction() > +{ > + if [ ! -f /proc/sys/vm/compact_memory ]; then > + _notrun "Need compaction enabled CONFIG_COMPACTION=y" > + fi > +} > # Get hugepagesize in bytes > _get_hugepagesize() > { > diff --git a/tests/generic/750 b/tests/generic/750 > new file mode 100755 > index 000000000000..334ab011dfa0 > --- /dev/null > +++ b/tests/generic/750 > @@ -0,0 +1,62 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2024 Luis Chamberlain. All Rights Reserved. > +# > +# FS QA Test 750 > +# > +# fsstress + memory compaction test > +# > +. ./common/preamble > +_begin_fstest auto rw long_rw stress soak smoketest > + > +_cleanup() > +{ > + cd / > + rm -f $runfile > + rm -f $tmp.* > + kill -9 $trigger_compaction_pid > /dev/null 2>&1 > + $KILLALL_PROG -9 fsstress > /dev/null 2>&1 > + > + wait > /dev/null 2>&1 > +} > + > +# Import common functions. > + > +# real QA test starts here > + > +_supported_fs generic > + > +_require_scratch > +_require_vm_compaction > +_require_command "$KILLALL_PROG" "killall" > + > +# We still deadlock with this test on v6.10-rc2, we need more work. > +# but the below makes things better. > +_fixed_by_git_commit kernel d99e3140a4d3 \ > + "mm: turn folio_test_hugetlb into a PageType" > + > +echo "Silence is golden" > + > +_scratch_mkfs > $seqres.full 2>&1 > +_scratch_mount >> $seqres.full 2>&1 > + > +nr_cpus=$((LOAD_FACTOR * 4)) > +nr_ops=$((25000 * nr_cpus * TIME_FACTOR)) > +fsstress_args=(-w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus) > + > +# start a background trigger for memory compaction > +runfile="$tmp.compaction" > +touch $runfile > +while [ -e $runfile ]; do > + echo 1 > /proc/sys/vm/compact_memory > + sleep 5 > +done & > +trigger_compaction_pid=$! > + > +test -n "$SOAK_DURATION" && fsstress_args+=(--duration="$SOAK_DURATION") > + > +$FSSTRESS_PROG $FSSTRESS_AVOID "${fsstress_args[@]}" >> $seqres.full > +wait > /dev/null 2>&1 Won't this "wait" wait forever (except a ctrl+C), due to no one removes the $runfile? Thanks, Zorro > + > +status=0 > +exit > diff --git a/tests/generic/750.out b/tests/generic/750.out > new file mode 100644 > index 000000000000..bd79507b632e > --- /dev/null > +++ b/tests/generic/750.out > @@ -0,0 +1,2 @@ > +QA output created by 750 > +Silence is golden > -- > 2.43.0 > >