From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42B29C2B9F4 for ; Thu, 17 Jun 2021 22:01:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AEE0960FE3 for ; Thu, 17 Jun 2021 22:01:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AEE0960FE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 13F966B0070; Thu, 17 Jun 2021 18:01:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F03B6B0071; Thu, 17 Jun 2021 18:01:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EAC1D6B0072; Thu, 17 Jun 2021 18:01:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id B6A816B0070 for ; Thu, 17 Jun 2021 18:01:36 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 541E2180AD81F for ; Thu, 17 Jun 2021 22:01:36 +0000 (UTC) X-FDA: 78264588192.01.52CFB7C Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by imf11.hostedemail.com (Postfix) with ESMTP id C3D2F20010AA for ; Thu, 17 Jun 2021 22:01:35 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id w4so3445078ior.1 for ; Thu, 17 Jun 2021 15:01:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0jCUxN5VHbSW7yt0ADd96KTkL0vWh52LCH6fuo5IQ6o=; b=VQkoz7r72eZsC1B8HO8sxUZehcSmGzZqVhEA6opP9exuy8mwknqwhSBR/MMHeXfy6n NVOQX19E3NM/H9sBMCiTJqE+bnK6Q66QpRKiBWG+Apn+CfBZqMOlOR677l8zrhv5QQW/ EhAZRNcarGAKIBXqg5qafRVs2aBSi0J1XdL7cpmNMr5OzJI1u7rJUnJZvyusCAmXHltz HVc/2AaQDwCP/XcAEQVZ2PWJW+WUKKkMKq+1n1sMAGbyc44XHM7CDsKg0UFLvS5q7fOi eNP96UzF9QIvrmz6rZSdPVn6q8LQl6fAGQrG1cr10+8luv9eJpZvd7DNQjHCxnwGy6Dq LoEw== X-Gm-Message-State: AOAM530bFUe18C05RDbRC/92BWRVyiM3KBLLeGSPHj0BlI9I4CtVCc5O K6qXZALIaTKA7m8SLCySYkM= X-Google-Smtp-Source: ABdhPJzZezAeX+10l0RtyH2LwFjrlZTciRKNZU8/wa4NlvJjN3TjD369mvVHqO9ZrhRcKYBIojYZjw== X-Received: by 2002:a05:6602:2c4e:: with SMTP id x14mr5472295iov.194.1623967295221; Thu, 17 Jun 2021 15:01:35 -0700 (PDT) Received: from google.com (243.199.238.35.bc.googleusercontent.com. [35.238.199.243]) by smtp.gmail.com with ESMTPSA id f7sm996452ioc.18.2021.06.17.15.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 15:01:34 -0700 (PDT) Date: Thu, 17 Jun 2021 22:01:33 +0000 From: Dennis Zhou To: Matthew Wilcox Cc: Roman Gushchin , Tejun Heo , Christoph Lameter , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] percpu: optimize locking in pcpu_balance_workfn() Message-ID: References: <20210617190322.3636731-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C3D2F20010AA X-Stat-Signature: uiuu18rzoc6hwth7c75xisn79hzhd9tq Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of dennisszhou@gmail.com designates 209.85.166.53 as permitted sender) smtp.mailfrom=dennisszhou@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) X-HE-Tag: 1623967295-745219 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hello, On Thu, Jun 17, 2021 at 08:56:23PM +0100, Matthew Wilcox wrote: > On Thu, Jun 17, 2021 at 12:03:22PM -0700, Roman Gushchin wrote: > > +++ b/mm/percpu.c > > @@ -1980,6 +1980,9 @@ void __percpu *__alloc_reserved_percpu(size_t size, size_t align) > > * If empty_only is %false, reclaim all fully free chunks regardless of the > > * number of populated pages. Otherwise, only reclaim chunks that have no > > * populated pages. > > + * > > + * CONTEXT: > > + * pcpu_lock (can be dropped temporarily) > > */ > > What's the shouting all about? I would write it like this: At this point it's just to keep the code consistent. > > * Context: Process context. Caller must hold pcpu_lock with interrupts > * disabled. This function may drop the lock and re-enable interrupts if > * it needs to sleep, but will return with the lock held and interrupts > * disabled. > This is related to background work done via a workqueue not in process context. I'll take a look at cleaning up the documentation in the future. Thanks, Dennis