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 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A97C6C33CB1 for ; Thu, 16 Jan 2020 13:49:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7919A207E0 for ; Thu, 16 Jan 2020 13:49:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RZe26A8s" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726343AbgAPNtw (ORCPT ); Thu, 16 Jan 2020 08:49:52 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29193 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726084AbgAPNtw (ORCPT ); Thu, 16 Jan 2020 08:49:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579182591; 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; bh=tW8QepJVzZQv/Ygdvwl07xvaRaFmGC5EBwa4NFuhNeM=; b=RZe26A8s2scI2oGnKkHVHBdsYZVypQ6QvwYI0Pte1PRbd58FOBycLPYf77WHk/LaCdFBC0 jQo3kqg9+XIgKcDn1Nl8vZPkozUOqhOcnlL0E8cF3tZeQSuOkhKs1/Q9bins3fR5ljLES/ tiiT5dNFF4yIlG2wIlA20Sm7q7onwBI= 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-92-jzdK0iVEON-09vfB4a5Ciw-1; Thu, 16 Jan 2020 08:49:50 -0500 X-MC-Unique: jzdK0iVEON-09vfB4a5Ciw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E9EC8DF704; Thu, 16 Jan 2020 13:49:49 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-117-242.ams2.redhat.com [10.36.117.242]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF7AA860DA; Thu, 16 Jan 2020 13:49:47 +0000 (UTC) From: Stefano Garzarella To: Jens Axboe Cc: Alexander Viro , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH] io_uring: wakeup threads waiting for EPOLLOUT events Date: Thu, 16 Jan 2020 14:49:46 +0100 Message-Id: <20200116134946.184711-1-sgarzare@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Content-Transfer-Encoding: quoted-printable Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org io_uring_poll() sets EPOLLOUT flag if there is space in the SQ ring, then we should wakeup threads waiting for EPOLLOUT events when we expose the new SQ head to the userspace. Signed-off-by: Stefano Garzarella --- Do you think is better to change the name of 'cq_wait' and 'cq_fasync'? Thanks, Stefano --- fs/io_uring.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/io_uring.c b/fs/io_uring.c index 38b54051facd..5c6ff5f9e741 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3687,6 +3687,11 @@ static void io_commit_sqring(struct io_ring_ctx *c= tx) * write new data to them. */ smp_store_release(&rings->sq.head, ctx->cached_sq_head); + + if (wq_has_sleeper(&ctx->cq_wait)) { + wake_up_interruptible(&ctx->cq_wait); + kill_fasync(&ctx->cq_fasync, SIGIO, POLL_OUT); + } } } =20 --=20 2.24.1