From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 28 22:07:47 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 495A3425 for ; Mon, 28 Oct 2013 22:07:47 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qa0-x231.google.com (mail-qa0-x231.google.com [IPv6:2607:f8b0:400d:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8882318 for ; Mon, 28 Oct 2013 22:07:46 +0000 (UTC) Received: by mail-qa0-f49.google.com with SMTP id i13so2489031qae.1 for ; Mon, 28 Oct 2013 15:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=pxFa+Uaq79G/YjslIHme0qLcXbkXouEugyeOj/YQ690=; b=EK9xKA94sAsDhGKQ44zn6rIk4ehNRAJR53f2aOcsSsXTf18iIbsZEtx279cJmeRL04 LVapcy7bHDwW7FIuA2zlBX1kykNk0CE072FhMKak7OsdYRiqoLVe5LR2/8mflosvh0SI MF986cKigqQzmEEYJ0W4LC6m+a33q1T/Of8CCtjuSIjQ+SqGVLOaoGjEfPWS88tAIPPv sfZs9MjqlpdQCe9d0tGN/suF4YkyHDR9eFuS8Q3v3CUuMWZsJ9XfJVBCTE5U7iga0Tev SeOVy4GtfU0WhSh182ljVtYOlDBYfv0woXSNrvMfx2UP9KktQM+tPRqLfZbe77uNSD5g 2alA== MIME-Version: 1.0 X-Received: by 10.224.36.201 with SMTP id u9mr32497661qad.76.1382998057595; Mon, 28 Oct 2013 15:07:37 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Mon, 28 Oct 2013 15:07:37 -0700 (PDT) In-Reply-To: <1382995311.800352930@f402.i.mail.ru> References: <1382995311.800352930@f402.i.mail.ru> Date: Mon, 28 Oct 2013 15:07:37 -0700 X-Google-Sender-Auth: 4QOXOlZq_GN5I6OVfk_YNWqDH3o Message-ID: Subject: Re: closing kqueue descriptor doesn't release associated kernel resources? From: Adrian Chadd To: Alexey Egorov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2013 22:07:47 -0000 Hi! Yes. The POSIX AIO API puts the responsibility on the programmer to correctly terminate requests: * aborting them with aio_cancel() (and it succeeding), or * waiting for them to complete. So yes, you're going to have to track them and correctly abort/complete the requests. Thanks, -adrian On 28 October 2013 14:21, Alexey Egorov wrote: > > Hello all, > I'm porting application from Linux which uses libaio for async disk IO. > On FreeBSD we are using kqueue + posix AIO, but I discovered that closing= kqueue descriptor doesn't release associated aio requests - sysctl value v= fs.aio.num_queue_count keeps growing each time I'm close kqueue fd without = waiting for aio requests to complete, and then at some point when limit is = reached program hangs. > Problem getting harder considering that I'm doing IO on raw disk device a= nd can't cancel requests with aio_cancel(2). > Is it a bug? How can I release this requests without terminating process = or waiting for all requests to complete? > Thanks. > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= "