From patchwork Mon Aug 17 13:49:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 7025211 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 47DD49F373 for ; Mon, 17 Aug 2015 13:50:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 547842068E for ; Mon, 17 Aug 2015 13:50:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0001A20672 for ; Mon, 17 Aug 2015 13:49:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750892AbbHQNt6 (ORCPT ); Mon, 17 Aug 2015 09:49:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57887 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbbHQNt6 (ORCPT ); Mon, 17 Aug 2015 09:49:58 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 1E0E683F9E; Mon, 17 Aug 2015 13:49:58 +0000 (UTC) Received: from localhost (vpn1-7-76.pek2.redhat.com [10.72.7.76]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7HDntcM026643; Mon, 17 Aug 2015 09:49:57 -0400 From: Zorro Lang To: fstests@vger.kernel.org Cc: eguan@redhat.com, david@fromorbit.com, Zorro Lang Subject: [PATCH v3] generic/084: use src/multi_open_unlink to replace tail command Date: Mon, 17 Aug 2015 21:49:53 +0800 Message-Id: <1439819393-7713-1-git-send-email-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP generic/084 try to run 'tail' command, tail will use inotify. There're some limit about the number of inotify. For example fs.inotify.max_user_instances specifies an upper limit on the number of inotify instances that can be created per real user ID. When I test on a machine with 154 cpu cores, this case run failed, and hit many warning likes: +tail: inotify cannot be used, reverting to polling: Too many open files Because the fs.inotify.max_user_instances is 128, so if we try to tail 154 files, it will be failed. So use src/multi_open_unlink to instead of tail will avoid this problem. Signed-off-by: Zorro Lang Reviewed-by: Eryu Guan Reviewed-by: Dave Chinner Reviewed-by: Eryu Guan --- tests/generic/084 | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/generic/084 b/tests/generic/084 index 3fec6c2..d5061a7 100755 --- a/tests/generic/084 +++ b/tests/generic/084 @@ -69,15 +69,8 @@ _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount # create, open & unlinked files so unlinked inode list is not empty -for i in `seq 1 $nr_cpu`; do - testfile=$SCRATCH_MNT/$seq.unlinked.$i - touch $testfile - tail -f $testfile & - tail_pids="$tail_pids $!" -done -# give tail some time to open the file before the file is removed -sleep 1 -rm -f $SCRATCH_MNT/$seq.unlinked.* +src/multi_open_unlink -f $SCRATCH_MNT/$seq.unlinked -n $nr_cpu -s 1000 & +open_pid=$! # start link/unlink storm src=$SCRATCH_MNT/$seq.target @@ -96,8 +89,8 @@ done & sleep 5 kill $! >/dev/null 2>&1 -kill $tail_pids $link_pids >/dev/null 2>&1 -wait $tail_pids $link_pids +kill $open_pid $link_pids >/dev/null 2>&1 +wait $open_pid $link_pids # all done, no oops/hang expected, _check_filesystems checks SCRATCH_DEV after test status=0