From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933764AbdKBBYQ (ORCPT ); Wed, 1 Nov 2017 21:24:16 -0400 Received: from mx0b-00190b01.pphosted.com ([67.231.157.127]:60104 "EHLO mx0b-00190b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751988AbdKBBYO (ORCPT ); Wed, 1 Nov 2017 21:24:14 -0400 Subject: Re: [PATCH] epoll: remove ep_call_nested() from ep_eventpoll_poll() To: Andrew Morton , Davidlohr Bueso Cc: linux-kernel@vger.kernel.org, Alexander Viro , Salman Qazi , Hou Tao References: <1509430214-5599-1-git-send-email-jbaron@akamai.com> <20171031145821.ieflhlvs3la25vdw@linux-n805> <20171101135354.1ffec54e1fdedcca0f2086ce@linux-foundation.org> From: Jason Baron Message-ID: Date: Wed, 1 Nov 2017 21:24:04 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171101135354.1ffec54e1fdedcca0f2086ce@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-01_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711020017 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-01_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711020017 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/01/2017 04:53 PM, Andrew Morton wrote: > On Tue, 31 Oct 2017 07:58:21 -0700 Davidlohr Bueso wrote: > >> On Tue, 31 Oct 2017, Jason Baron wrote: >> >>> The use of ep_call_nested() in ep_eventpoll_poll(), which is the .poll >>> routine for an epoll fd, is used to prevent excessively deep epoll >>> nesting, and to prevent circular paths. However, we are already preventing >>> these conditions during EPOLL_CTL_ADD. In terms of too deep epoll chains, >>> we do in fact allow deep nesting of the epoll fds themselves (deeper >>> than EP_MAX_NESTS), however we don't allow more than EP_MAX_NESTS when >>> an epoll file descriptor is actually connected to a wakeup source. Thus, >>> we do not require the use of ep_call_nested(), since ep_eventpoll_poll(), >>> which is called via ep_scan_ready_list() only continues nesting if there >>> are events available. Since ep_call_nested() is implemented using a global >>> lock, applications that make use of nested epoll can see large performance >>> improvements with this change. >> >> Improvements are quite obscene actually, such as for the following epoll_wait() >> benchmark with 2 level nesting on a 80 core IvyBridge: >> >> ncpus vanilla dirty delta >> 1 2447092 3028315 +23.75% >> 4 231265 2986954 +1191.57% >> 8 121631 2898796 +2283.27% >> 16 59749 2902056 +4757.07% >> 32 26837 2326314 +8568.30% >> 64 12926 1341281 +10276.61% >> >> (http://linux-scalability.org/epoll/epoll-test.c) > > This is tempting, but boy it is late in the -rc cycle. > > How important are these workloads? Would the world end if we held off > on this for 4.15? > Hi Andrew, As Davidlohr pointed out, the nested epoll case is less common and these locks have been here for a long time. I also think the patch needs to be in linux-next for a bit and validated more, before hitting mainline. Thanks, -Jason