Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3960000ybh; Tue, 17 Mar 2020 09:36:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vubqYl1InDYyRKEdXcuAz11U78AhJPVYGkO1Q1ito7Ip7LkvxcZPxqiwX5lMf8MqUBW9rZP X-Received: by 2002:a9d:de8:: with SMTP id 95mr97195ots.160.1584462984794; Tue, 17 Mar 2020 09:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584462984; cv=none; d=google.com; s=arc-20160816; b=nSEApoIJ4gBBCfL1asREc3nkxfftnv/Eni/3Qi9rl7Ujw4SPexc1VQWFHZfK9M90E3 5bE3diwsx5AXNH7NduHcQ7J2QbghtpojM0t63JaU8v6mr8XhuS+g2hRmecvWarVQqLLm JKvUP2bZAoGvUbKPOKyVV0bWTbQqhUfWhQrvyZ8lyimq23YstFQzUyfje7cf9XVfvKwE v/xAtbhJY+AWTscWJmwfij9h3RWEsEiRzk4l8I18175hCqOJCdJJHAmLNiCTtDyS+rGm IapYt++JpiRcizuZsuGl+qhCO5BkMMCn83mJTMBkdxLWKU6zBVKd/l3GnWTXRNl9oEiw p+MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=bfQfE8Vw5JfnsdpF5qpxo61WbWi4rbzWgqKGkl4pvao=; b=uwtbbfc+D8yS2q80d/vdHjnF1W3MB2XnnCdTj510oTdo5SBY8BQ/A+GRaR+e16Y1HX L43N50f1x0FZLtO3XyCvani23Am07RYnHQo4l/zQ4cquytShIlDHQmXQ5ZHeRSBdBHgu XGfwebCW57/Lw9TFV8LV5nDPGxik04KQ2bCNa2+GP642KwhR7tRynHmvmjC4TLG7eZDe 7Yh21G3zMId5ETc/aHeeWyTJUNvvm/FURhU3y1eyQDVHlkhM3HPjrqWMi4B9gGhkqAy2 uDr7F8cgF61ssxLN05mLaUddOpQcVqJ5O9mUJUG4ve3m5taYntElRTnNvCkU94OdcnZR 42/w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i19si1887789oie.253.2020.03.17.09.36.12; Tue, 17 Mar 2020 09:36:24 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726474AbgCQQfo (ORCPT + 99 others); Tue, 17 Mar 2020 12:35:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:42914 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbgCQQfo (ORCPT ); Tue, 17 Mar 2020 12:35:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B3C8EAF84; Tue, 17 Mar 2020 16:35:42 +0000 (UTC) Date: Tue, 17 Mar 2020 09:34:43 -0700 From: Davidlohr Bueso To: Jason Baron Cc: akpm@linux-foundation.org, rpenyaev@suse.de, linux-kernel@vger.kernel.org, normalperson@yhbt.net, viro@zeniv.linux.org.uk Subject: Re: [PATCH v2] fs/epoll: make nesting accounting safe for -rt kernel Message-ID: <20200317163443.o5ffdpkp5t6axsl3@linux-p48b> References: <20200224163835.08ab964483519052d7c2e39b@linux-foundation.org> <1582739816-13167-1-git-send-email-jbaron@akamai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1582739816-13167-1-git-send-email-jbaron@akamai.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Feb 2020, Jason Baron wrote: >Davidlohr Bueso pointed out that when CONFIG_DEBUG_LOCK_ALLOC is set >ep_poll_safewake() can take several non-raw spinlocks after disabling >interrupts. Since a spinlock can block in the -rt kernel, we can't take a >spinlock after disabling interrupts. So let's re-work how we determine >the nesting level such that it plays nicely with the -rt kernel. > >Let's introduce a 'nests' field in struct eventpoll that records the >current nesting level during ep_poll_callback(). Then, if we nest again we >can find the previous struct eventpoll that we were called from and >increase our count by 1. The 'nests' field is protected by >ep->poll_wait.lock. > >I've also moved the visited field to reduce the size of struct eventpoll >from 184 bytes to 176 bytes on x86_64 for !CONFIG_DEBUG_LOCK_ALLOC, >which is typical for a production config. > >Reported-by: Davidlohr Bueso >Signed-off-by: Jason Baron Sorry for the tardy reply. This looks good to me: Reviewed-by: Davidlohr Bueso