From owner-freebsd-hackers@FreeBSD.ORG Mon May 13 18:09:55 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 28DD0B4B for ; Mon, 13 May 2013 18:09:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) by mx1.freebsd.org (Postfix) with ESMTP id B94CAE54 for ; Mon, 13 May 2013 18:09:54 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id k13so6746013wgh.7 for ; Mon, 13 May 2013 11:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=OUfDumtgsWyLb1xuQm7uJnCjvYfKUChlDAf97ClWkMo=; b=lmPooSK4Sb9gJnUaih83DJ0sCb6D0s7da8fLuESeeHM6DGtjeqLSbtMxF5TL5M+YnE kr7zT9fEPxjpY/cgekLQnAftrdsA+9G74rnUdLBl2GXqAdfGUOwmtxTML1B2RJeTcjpP Kvvr0MTVjvbrXh9D4vWkB1qsWmMQaDEZ6IW+el/SGpe07GpfS4zcLFa3nvCB8H9+RH9U 638r+Soqrzwr2EYQosodmgx3wpCtxa48RWRbCzi8r2370zl6abd3RUBBMVP9kHpuahPz WJQxqbYflvQfMIYuOXwTjsEIz/YQWs5PVcroc/DRD5md/PiHFHufNR5uEm6YliznaXdE TsBw== MIME-Version: 1.0 X-Received: by 10.180.37.229 with SMTP id b5mr7471978wik.29.1368468593877; Mon, 13 May 2013 11:09:53 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Mon, 13 May 2013 11:09:53 -0700 (PDT) In-Reply-To: <20130513185357.1c552be5@shy.leonerd.org.uk> References: <20130513185357.1c552be5@shy.leonerd.org.uk> Date: Mon, 13 May 2013 11:09:53 -0700 X-Google-Sender-Auth: 3hMIm7dg1fcjbdKidqCK9gyU4HE Message-ID: Subject: Re: Managing userland data pointers in kqueue/kevent From: Adrian Chadd To: Paul LeoNerd Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, Eugen-Andrei Gavriloaie 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, 13 May 2013 18:09:55 -0000 On 13 May 2013 10:53, Paul LeoNerd wrote: > [I'm not currently on the list so please forgive the manually-crafted > reply] > >> I'm confused as to why this is still an issue. Sure, fix the kqueue >> semantics and do it in a way that doesn't break backwards >> compatibility. > > I suggested that. Add a user->kernel flag > > EV_DROPWATCH > > which, if present, causes kernel to send back to userland events with > the kernel->user flag > > EV_DROPPING > > any time it drops the pointer. Then trivially userland just has to set > that flag on all its events to the kernel, and remember to send those > events back to userland when it does in fact drop them. Cool! Ok. I'll go bring this up at bsdcan and see what people think. I haven't been knee deep in this stuff for a few years (but am about to again, damned HTTP proxies!) and I would love to have better semantics here. I just want to make sure it doesn't cause weird things for the non-socket case - ie, files (local, NFS) and signals. Adrian