Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423379Ab3CVWSK (ORCPT ); Fri, 22 Mar 2013 18:18:10 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:39854 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422924Ab3CVWSH convert rfc822-to-8bit (ORCPT ); Fri, 22 Mar 2013 18:18:07 -0400 MIME-Version: 1.0 In-Reply-To: <20130322103102.GA4818@dcvr.yhbt.net> References: <20130321115259.GA17883@dcvr.yhbt.net> <20130322032410.GA19377@dcvr.yhbt.net> <20130322103102.GA4818@dcvr.yhbt.net> Date: Fri, 22 Mar 2013 15:18:06 -0700 Message-ID: Subject: Re: [RFC v3 1/2] epoll: avoid spinlock contention with wfcqueue From: =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= To: Eric Wong Cc: linux-kernel@vger.kernel.org, Davide Libenzi , Al Viro , Andrew Morton , Mathieu Desnoyers , linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1424 Lines: 37 On Fri, Mar 22, 2013 at 3:31 AM, Eric Wong wrote: > Arve Hj?nnev?g wrote: >> On Thu, Mar 21, 2013 at 8:24 PM, Eric Wong wrote: >> > >> > With EPOLLET and improper usage (not hitting EAGAIN), the event now >> > has a larger window to be lost (as mentioned in my changelog). >> > >> >> What about the case where EPOLLET is not set? The old code did not >> drop events in that case. > > Nothing is dropped, if the event wasn't on the ready list before, > ep_poll_callback may still append the ready list while __put_user > is running. > > If the event was on the ready list: > > 1) It does not matter for EPOLLONESHOT, it'll get masked out and > discarded in the next ep_send_events call until ep_modify reenables > it. Since ep_modify and ep_send_events both take ep->mtx, there's > no conflict. > > 2) Level Trigger - event stays ready, so nothing is dropped. > At some point the level triggered event has to get cleared. As far as I can tell, your new code will drop new events that occur between "revents = ep_item_poll(epi, &pt);" and "epi->state = EP_STATE_IDLE;" in that case. -- Arve Hj?nnev?g -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/