Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp386867ybl; Tue, 28 Jan 2020 05:08:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwkz/XEouN/gPJuWYFqOSyYyCe0TSVfECzEbPazbrRIeENdxRC7L0TQBvxzSVKHMdtWp1yO X-Received: by 2002:a9d:63d6:: with SMTP id e22mr16419586otl.72.1580216934912; Tue, 28 Jan 2020 05:08:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580216934; cv=none; d=google.com; s=arc-20160816; b=PKzPfgV4VmmQZmjBIzLZ99vE7kOO3DpoE+jl2WpkQs8e4KrZ9bJtlsuZ8Ov1ttgWac vxM2YMeBmUtTZ/AR7hNlyEzUUkO1Pj9zWwsiT+l1kqvZgagKnM8LF855aaApV5J3CiEf WMTYqFCMmipkYII7RTGkVaJtZqwPy0+aQY2AccZB+Tvh+6WObb1xvFzBqk0sWIIbMJUi VIARtHWJbWh63HaBUwvO6nYSOtDImyWcwssKs7Q6eVSNIZiWdmfOJ/GA/0g2Hd709oxr OwQPLYsR5jEp/y5WV3ugCiM6Jv1tCNIyXR8TcRZ6Oly3EZdSORnr1hgEJKsa491RRZrd zq1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PVCZBoWITEVn0ar0L5LRVeQOwBalysgHCJ5R42wZfYg=; b=NBMZBys9m4beIOsEjOHhXG7lJoWlM+QVgzjfaE8cfMRbjGHOnnWHC/fNi+axrCL9RU I2P1puY2BeYbuf1DCoqZAzrpKLZ4sP0RrvMFbZbjboMNbO4uTscYSDPK8F4nMlppc3a+ Oghyzo6HCspYDntaMbXO+R8VSPzFDwpoAX6dhPnkNs4jgXx6LT49zrAuPtD9/QlPobCp KRvf2XXbLd0jCCpw7aVo2CgQLeMFD7BHLf2z9fHRkfCBJ275h7xlBcz520FRAToAXXzL WfSGjXMoPS8wOmpuyUxbJInaJFKwPMr6z7ZnyZU7LKhiKUSUiWf4xfJL2sHryZ2INe4d Wcog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aKKGxSDs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b191si1694520oii.266.2020.01.28.05.08.33; Tue, 28 Jan 2020 05:08:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aKKGxSDs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726066AbgA1NGw (ORCPT + 99 others); Tue, 28 Jan 2020 08:06:52 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:55068 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725283AbgA1NGw (ORCPT ); Tue, 28 Jan 2020 08:06:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580216812; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PVCZBoWITEVn0ar0L5LRVeQOwBalysgHCJ5R42wZfYg=; b=aKKGxSDsN79xFOg8vcf9IlKtLbHaBK9ZrZSFYeOS0vv5m8Jaj5LCkJX2D/Ch7mV+6F0h12 3QoxANEWeopJcP2aO/L1XCAG+4TCBpUMMgTC/8BiVHdp+xRk0kEbygVP8h0koDe8B1LnUZ y+raXxSb67A2zp4PiXerKmgndzn0nJ8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-341-PaIKuNKXNAyBk2kvY5Du7A-1; Tue, 28 Jan 2020 08:06:50 -0500 X-MC-Unique: PaIKuNKXNAyBk2kvY5Du7A-1 Received: by mail-wm1-f70.google.com with SMTP id b202so903284wmb.2 for ; Tue, 28 Jan 2020 05:06:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=PVCZBoWITEVn0ar0L5LRVeQOwBalysgHCJ5R42wZfYg=; b=pvW8Wj6rxqAdLqlJNfJ2sdDxpFn11lVx89T3UnpqDdhsOl5mxFu74BURFgHUnGZk9K lfzr2KMWjvMMlKxlaIcnlySj2Et+BAolxD1z8qgHQX9HdEIXUAkHRQoqofA1C4RbdfoD T5cFlHaNTkEriQ+ZCSzS3I/J7ZcrmHoF8DMPZZvTloPHZw/FhmD2YAWvJSm3+MUz+E7E ju/kx6MtueHwvo1k2UBA/8QarGn2oh00KBD6CozRBRtGmqSDRXu2TosJlV1vGjZVynlX O3FkJSA6YnR30JTciokfgUFrpW274c+v5wzB9GuxuHQAxMJy+ha5KD8BRkIkgsgYwEzb UrlQ== X-Gm-Message-State: APjAAAXLCOFE/e4ikL2iICl29DZFl3YpaHcGPBTyLZC+R//t3SLQLUz5 QA0IYN8HD7r0whKGzKCN1NEFCHx5tFBukt77x2S9yH1RuSh2igCDovdhFczvJF0OiKC+D7J2qec +Rlvsmz9dwudKLkxg9zSZw7tY X-Received: by 2002:a5d:4d4a:: with SMTP id a10mr30027650wru.220.1580216808937; Tue, 28 Jan 2020 05:06:48 -0800 (PST) X-Received: by 2002:a5d:4d4a:: with SMTP id a10mr30027618wru.220.1580216808670; Tue, 28 Jan 2020 05:06:48 -0800 (PST) Received: from steredhat (85-207-217-101.static.bluetone.cz. [85.207.217.101]) by smtp.gmail.com with ESMTPSA id v17sm25046478wrt.91.2020.01.28.05.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 05:06:48 -0800 (PST) Date: Tue, 28 Jan 2020 14:06:46 +0100 From: Stefano Garzarella To: Jens Axboe Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH liburing 1/1] test: add epoll test case Message-ID: <20200128130646.n3x5co7n3m7gbyzy@steredhat> References: <20200127161701.153625-1-sgarzare@redhat.com> <20200127161701.153625-2-sgarzare@redhat.com> <20200127182534.5ljsj53vzpj6kkru@steredhat> <646cbb04-9bef-0d99-64ec-322d1584abe7@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <646cbb04-9bef-0d99-64ec-322d1584abe7@kernel.dk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 27, 2020 at 11:46:34AM -0700, Jens Axboe wrote: > On 1/27/20 11:25 AM, Stefano Garzarella wrote: > > On Mon, Jan 27, 2020 at 09:32:43AM -0700, Jens Axboe wrote: > >> On 1/27/20 9:17 AM, Stefano Garzarella wrote: > >>> Signed-off-by: Stefano Garzarella > >> > >> You're not reaping CQ events, and hence you overflow the ring. Once > >> overflown, an attempt to submit new IO will returns in a -16/-EBUSY > >> return value. This is io_uring telling you that it won't submit more > >> IO until you've emptied the completion ring so io_uring can flush > >> the overflown entries to the ring. > > > > How can I reaping CQ events? (I was hoping the epoll would help me with that) > > > > What I'm seeing is that the producer (EPOLLOUT) can fill the SQ without issues, > > the consumer (read()) is receiving all the buffers produced, but the thread > > that frees the buffers (EPOLLIN) is not woken up. > > > > I tried to set a timeout to the epoll_wait(), but the io_uring_peek_cqe() > > returns -EAGAIN. > > > > If I'm using a ring with 16 entries, it seems to work better, but > > sometimes I lose events and the thread that frees the buffer doesn't wake up. > > > > Maybe I'm missing something... > > OK, so that helps in terms of understanding the issue you are seeing with > it. I'll take a look at this, but it'll probably be a few days. You can > try and enable tracing, I see events completed just fine. Maybe a race > with your epoll wait and event reaping? (discard previous email wrongly sent by my phone, sorry for the noise) Okay, the issue was that my kernel doesn’t support IORING_FEAT_NODROP, so for this reason I missed the CQ events. Avoiding the CQ overflow keeping this condition true (submitted - completed < n_entries), solves the issue. I’ll try with a mainline kernel, handling also the -EBUSY returned by io_uring_submit(). Thanks, Stefano