Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp17170imm; Tue, 17 Jul 2018 19:39:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcrtBGzNxoDLucjtcwt4Y3tuczeAfVxa5ROJwddRBKX+VSpUr/E0sMApuBZDn6UCtxnkkic X-Received: by 2002:a62:1a4a:: with SMTP id a71-v6mr3283775pfa.190.1531881577455; Tue, 17 Jul 2018 19:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531881577; cv=none; d=google.com; s=arc-20160816; b=ZXRMxpxHJok0vXcuGJKqeUqrtKngO98P2p2OPNrO/e65+W8ELOwcqEedTVF7rHkcZ+ LivBIppyBV3bOsWRMg0c9VNv/aiHUV8UjNrg27Fg+ptjHErUvJTKpGBdaVzKQKIY1eFf +v54BITXLXNf/AyQ2kkx2HfgJFJcDcAnwFGbmBzxjE9EFA/nywHLiarh5p9CzUGVOWKH nKBuYEhJm8e3I7+aT4/Z62OH+dO/8r+qPYve5i5sM671kJKmAaaA5L8GwsRe2MAoEA3e 1NM1pvsQFespGohE+GJNO1POJFni3IMztvJBa+Bd6VgugkTXeF9rzZu1hXzaWHkZQKMV NaHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=zBoJ3YvN+HKykMF8nM5Sbku5Q4vb74bs27Rsd7e3RvY=; b=KIWQxzKek9eIM4+LWiPRmLie+NJ9E+3ZvWgA7huaskaoD8k5YTWwALGzeCK91/zL2g R/e/lafPE4y5h7oqJ7+72WdKLt4X2hmJP2czK1pE6uadxP423s0sApBeT9KgmbeV9TTa M7JMOOd80nC8oUTqvrV3Oa1iOT6oyvxiIRNSOuULDf+l7/T/CHcvyFIqpppAGV1AjfkX GpaGENUlxt7dk/O+6QrhAqPYCFvB5aJ39epmApdzjJTEGFJbjKAkvVeG3f/Hj8Bqp3pK J+9gmpazK/HpAAmvQIToFUEPnqwOs5S/KVzk4hOSH5EXTZ4U+sV/o/4bGmm5y8gwH03n Sx6A== 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 w19-v6si2071148pfn.160.2018.07.17.19.39.21; Tue, 17 Jul 2018 19:39:37 -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 S1731672AbeGRDOQ (ORCPT + 99 others); Tue, 17 Jul 2018 23:14:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43978 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731193AbeGRDOP (ORCPT ); Tue, 17 Jul 2018 23:14:15 -0400 Received: from localhost.localdomain (c-24-4-125-7.hsd1.ca.comcast.net [24.4.125.7]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 66B63BD1; Wed, 18 Jul 2018 02:38:42 +0000 (UTC) Date: Tue, 17 Jul 2018 19:38:41 -0700 From: Andrew Morton To: Omar Sandoval Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexey Dobriyan , Eric Biederman , James Morse , Bhupesh Sharma , kernel-team@fb.com Subject: Re: [PATCH v2 2/7] proc/kcore: replace kclist_lock rwlock with rwsem Message-Id: <20180717193841.271d1c57b6f88d75c83892be@linux-foundation.org> In-Reply-To: <783ba3becc424db45e5d5c93559fc40ef6173f01.1531440458.git.osandov@fb.com> References: <783ba3becc424db45e5d5c93559fc40ef6173f01.1531440458.git.osandov@fb.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Jul 2018 17:09:34 -0700 Omar Sandoval wrote: > From: Omar Sandoval > > Now we only need kclist_lock from user context and at fs init time, and > the following changes need to sleep while holding the kclist_lock. > > ... > > --- a/fs/proc/kcore.c > +++ b/fs/proc/kcore.c > @@ -59,8 +59,8 @@ struct memelfnote > }; > > static LIST_HEAD(kclist_head); > -static DEFINE_RWLOCK(kclist_lock); > -static int kcore_need_update = 1; > +static DECLARE_RWSEM(kclist_lock); > +static atomic_t kcore_need_update = ATOMIC_INIT(1); It's unclear why kcore_need_update was changed to atomic_t - it's still updated under kclist_lock? Maybe it's for a later patch.