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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 BB780C48BE5 for ; Thu, 17 Jun 2021 19:56:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 65B5A61040 for ; Thu, 17 Jun 2021 19:56:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65B5A61040 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E29026B0070; Thu, 17 Jun 2021 15:56:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB0946B0071; Thu, 17 Jun 2021 15:56:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2A386B0072; Thu, 17 Jun 2021 15:56:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id 8BDA56B0070 for ; Thu, 17 Jun 2021 15:56:49 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2B87C1DE6F for ; Thu, 17 Jun 2021 19:56:49 +0000 (UTC) X-FDA: 78264273738.26.8600BD0 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf17.hostedemail.com (Postfix) with ESMTP id 4B2014202A0B for ; Thu, 17 Jun 2021 19:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BPwCBaM2/rXap2bK8yH+/+88XwXW6S6pZJPqaJg7YAk=; b=hg8S7OiTDHQGGkZyhWRzI5ChBo QernoMDwF0ezvcw1n7+6xa5DlyFUCy/5u8rMKjbrdi+5WPVSDEowii9wpp46u+JLMiKaiIG1GJEi7 cYFaw318ltqw+hmlmCiqtRSptC/LSnDIU7Q84cH6KqVb8t0VVeDETHgdUUWcJ9tjik0f2p4Jv3/pL k8siuykHzK9vQKI37WeErhPHkb0NaThoZhbq8UG89VWz2hCD2ndQ/Q8TH7jRbui+3Wi4PTaCj4efv j50EBh4zTLXcDRX+iopx8x9Ka0fPUHKY33Z4hq0CgEqIjYdRmzD2H44d1AIdK1uLWHHHRWzwavDja ua6oIkkQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lty7j-009WLs-8T; Thu, 17 Jun 2021 19:56:27 +0000 Date: Thu, 17 Jun 2021 20:56:23 +0100 From: Matthew Wilcox To: Roman Gushchin Cc: Dennis Zhou , 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: <20210617190322.3636731-1-guro@fb.com> Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=hg8S7OiT; spf=none (imf17.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4B2014202A0B X-Stat-Signature: 6jdcgg6g51ad8s9bz4fde93nnpirecgz X-HE-Tag: 1623959808-938021 X-Bogosity: Ham, tests=bogofilter, spamicity=0.026448, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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: * 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.