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 EB290C38142 for ; Mon, 23 Jan 2023 19:54:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232139AbjAWTy0 (ORCPT ); Mon, 23 Jan 2023 14:54:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231468AbjAWTyZ (ORCPT ); Mon, 23 Jan 2023 14:54:25 -0500 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCEA259EE; Mon, 23 Jan 2023 11:54:23 -0800 (PST) Date: Mon, 23 Jan 2023 14:54:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1674503662; 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=CdSQ03pYT6WirvAUNHMhKox0iGIyl9THQc3ark5MEwo=; b=MkamxbSLfWCz3S94Q5h94SbVDr40BLxpRcAac8P8Ee03u4xFoqIBCzRC9uSRdPoQgdsehf J+w7y+mpwDQ2EW3TxRGasOKRf1EP0ZVJRFEMg5YNlXpHKpnwMZAEzQT1Y4JFFcWtumFXDy /HD8erIZYR3lCf3R2tVGCidNWzHlX1I= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Jeff Moyer 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 Message-ID: References: <20230118152603.28301-1-kent.overstreet@linux.dev> <20230120140347.2133611-1-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 23, 2023 at 11:17:53AM -0500, Jeff Moyer wrote: > 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.... That's odd - let me know if you'd like me to take a look...