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 90688C38142 for ; Mon, 23 Jan 2023 16:14:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232925AbjAWQOt (ORCPT ); Mon, 23 Jan 2023 11:14:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233099AbjAWQOp (ORCPT ); Mon, 23 Jan 2023 11:14:45 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94CEB10A93 for ; Mon, 23 Jan 2023 08:14:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674490439; 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=LDRokBji3H//aUw+TxNZ5cyuNmI344JxNA+bsayunTs=; b=CxF9WSKmCvOwdr9YexeaFD9JtnP/fW2QTb0JDx4HqzNLwNc5dg6LCDHpSa0PV3lXMjLOvb GBQ8MlShbTp8D+ZWPjr3lHmmfQY7yVrdJcvXgsCEjSLNMC/nSSy6JgHfnILbEZPZdMKYRN 207zY+yYA6SzkfVCkeEddUhHwrhfAA4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-39-yO-SeMwmOfG2zLIJUksghg-1; Mon, 23 Jan 2023 11:13:56 -0500 X-MC-Unique: yO-SeMwmOfG2zLIJUksghg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D8E76281DE60; Mon, 23 Jan 2023 16:13:55 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B662240C2004; Mon, 23 Jan 2023 16:13:55 +0000 (UTC) From: Jeff Moyer To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2] fs/aio: obey min_nr when doing wakeups References: <20230118152603.28301-1-kent.overstreet@linux.dev> <20230120140347.2133611-1-kent.overstreet@linux.dev> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Mon, 23 Jan 2023 11:17:53 -0500 In-Reply-To: (Jeff Moyer's message of "Fri, 20 Jan 2023 14:47:42 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jeff Moyer writes: > Hi, Kent, > > Kent Overstreet writes: > >> I've been observing workloads where IPIs due to wakeups in >> aio_complete() are ~15% of total CPU time in the profile. Most of those >> wakeups are unnecessary when completion batching is in use in >> io_getevents(). >> >> This plumbs min_nr through via the wait eventry, so that aio_complete() >> can avoid doing unnecessary wakeups. >> >> v2: This fixes a race in the first version of the patch. If we read some >> events out after adding to the waitlist, we need to update wait.min_nr >> call prepare_to_wait_event() again before scheduling. > > I like the idea of the patch, and I'll get some real world performance > numbers soon. But first, this version (and the previous version as > well) fails test case 23 in the libaio regression test suite: > > Starting cases/23.p > FAIL: poll missed an event! > FAIL: poll missed an event! > test cases/23.t completed FAILED. It turns out that this only fails on the (relatively) old kernel against which I applied the patches. When I apply both patches to the latest tree, there is no test failure. Sorry for the noise, I'll be sure to test on the latest going forward. Now to figure out what changed elsewhere to fix this.... Cheers, Jeff