Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp48303imm; Tue, 17 Jul 2018 20:29:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcYu85KmaxELBHmPSAcEdhLG43t8LDY2ydvj0MwMdkG+SkVsI6CGWhD5B8G29Iu5NUgXbrB X-Received: by 2002:a62:d39b:: with SMTP id z27-v6mr3450579pfk.182.1531884545260; Tue, 17 Jul 2018 20:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531884545; cv=none; d=google.com; s=arc-20160816; b=XzeHMHFjvoIG3VrUVN4Q4SbKSr6jxfL3oBV05Kw39eDolVsaSyWW9xC6DknPuTVWdQ bUlmpDxgAfT7a6dOEGTTaMi4CVWEhfmZc8D8oWWooMoDJXjbAcrtIN3+g2wcVXR0ivmM SG/dNwB8LgQpTaY2f8MgEm+s1XG1Q5PwpHn8MX4Q/Y4oEgxu4/tDdTfo7gj2oG7nScu1 Bk+Qks1FyQYi+lkbqIrRWXRlrvVgsu6WaB0gbSiAQF7wMIyGYbCLRJ3GLMgDCJZNO1bI qpKH54sbQuHCXlzSJDQ0vikQR1ilitPtrOpW0G97QZTjrLhWGukT5G1bpBduXHxhVKYQ dijA== 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=pM5M+b/RIuyvWO+rGdZTiVnExDi+lIWTbAtJZHEztnE=; b=lgZAuRGrc6HuLLVWUSj3/MpHhPx5Z7XAmfRm/Itd5lCu3gQSriBlbms2w/9JJ/n+0S S9H8XAQ84k+0HdvlSN5AVIoMMlX2gW00/nYlzUuPt0XECkZqIRnNO7gOehLyqszcXiri tX0RTCnzn83iHh2syCSgJW5wgh8Z2AX0EErd7i9qFyyPesWRNdnuVUyNy5YGmzIN2HKN iNlYPjEJNZEczapcoLD1l0CK9Wu3FQBpsB1OTeThHdcunm33GzdwmEenJP04xgaGV90j nvrPEvlck3LxGzeaxDiOGlF+T+MyjyrLZVA3yC3hvmiyux2bv4d5FgRmdxSSLyRQwhEv 3kMQ== 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 e9-v6si2209067pgu.636.2018.07.17.20.28.50; Tue, 17 Jul 2018 20:29:05 -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 S1726572AbeGREDj (ORCPT + 99 others); Wed, 18 Jul 2018 00:03:39 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45818 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725721AbeGREDi (ORCPT ); Wed, 18 Jul 2018 00:03:38 -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 EAD6241C; Wed, 18 Jul 2018 03:27:54 +0000 (UTC) Date: Tue, 17 Jul 2018 20:27:53 -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: <20180717202753.d49795afde465d04b56efbfb@linux-foundation.org> In-Reply-To: <20180718032405.GB29351@vader> References: <783ba3becc424db45e5d5c93559fc40ef6173f01.1531440458.git.osandov@fb.com> <20180717193841.271d1c57b6f88d75c83892be@linux-foundation.org> <20180718032405.GB29351@vader> 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 Tue, 17 Jul 2018 20:24:05 -0700 Omar Sandoval wrote: > > > --- 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? > > Not in the hotplug notifier (kcore_callback()) anymore, so I need the > atomic_cmpxchg() in __kcore_update_ram(). Well that's just kcore_need_update = 1; and turning that into an atomic_set doesn't change anything(?). It's not a harmful change of course, but a bit ... odd. > That could use a mention in the commit message. That never hurts ;)