From patchwork Sun Sep 6 17:55:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 11759653 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D801892C for ; Sun, 6 Sep 2020 17:55:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB9EC20639 for ; Sun, 6 Sep 2020 17:55:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="B33Ob5Tc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729108AbgIFRzh (ORCPT ); Sun, 6 Sep 2020 13:55:37 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:46332 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729092AbgIFRzf (ORCPT ); Sun, 6 Sep 2020 13:55:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599414932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gTVUFOjmNGPItx0yFc9PQvMYCcQKYhuaxaFrNtS52Ks=; b=B33Ob5TcaxHlYpQSDEfL3gl4Hxljna1dENFTYbH2wcZZmOsBcIGtLtZ/Ph/sqzOPA0BV6R uBLg++1lzCWB521R1bHzEY/zp7sf1AMQ1HWUUY5px7IMrmz3fn8Fz2tfMvbJYnnX/3fXn6 wRILQAekSadT3aYSgqjiBYJ7P1XTvg4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-474-43rkGDvJP8irpoLWtEcMjA-1; Sun, 06 Sep 2020 13:55:28 -0400 X-MC-Unique: 43rkGDvJP8irpoLWtEcMjA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9097B18A224C; Sun, 6 Sep 2020 17:55:27 +0000 (UTC) Received: from bogon.redhat.com (ovpn-12-98.pek2.redhat.com [10.72.12.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A2DC9CBA; Sun, 6 Sep 2020 17:55:25 +0000 (UTC) From: Zorro Lang To: fstests@vger.kernel.org Cc: bfoster@redhat.com, io-uring@vger.kernel.org Subject: [PATCH v4 2/5] fsstress: reduce the number of events when io_setup Date: Mon, 7 Sep 2020 01:55:10 +0800 Message-Id: <20200906175513.17595-3-zlang@redhat.com> In-Reply-To: <20200906175513.17595-1-zlang@redhat.com> References: <20200906175513.17595-1-zlang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org The original number(128) of aio events for io_setup too big. When try to run lots of fsstress processes(e.g. -p 1000) always hit io_setup EAGAIN error, due to the nr_events exceeds the limit of available events. Due to each fsstress process only does once libaio read/write operation each time. So reduce the aio events number to 1, to make more fsstress processes can do AIO test. Signed-off-by: Zorro Lang Reviewed-by: Brian Foster --- ltp/fsstress.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ltp/fsstress.c b/ltp/fsstress.c index 2c584ef0..b4a51376 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -28,6 +28,7 @@ #endif #ifdef AIO #include +#define AIO_ENTRIES 1 io_context_t io_ctx; #endif #ifdef URING @@ -699,8 +700,8 @@ int main(int argc, char **argv) } procid = i; #ifdef AIO - if (io_setup(128, &io_ctx) != 0) { - fprintf(stderr, "io_setup failed"); + if (io_setup(AIO_ENTRIES, &io_ctx) != 0) { + fprintf(stderr, "io_setup failed\n"); exit(1); } #endif