Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp808585pxj; Thu, 17 Jun 2021 14:31:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9ZFjI9rv3dQH/EiFhZWRpDnB3m5rvrVk4rHofc1Aa7HJQx3wfHaW2UjMyO9wLUQx+Zuov X-Received: by 2002:a17:907:2895:: with SMTP id em21mr7246115ejc.164.1623965474922; Thu, 17 Jun 2021 14:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623965474; cv=none; d=google.com; s=arc-20160816; b=wZ4AR/8BcXxks+XmXFeRI5L63+IhVq/Z2sqvGOdx6OFXRm7zH2EVITMh/vTtpOyTho enMQhbQDDiceYIMztVDo1iC3ntSn10JGJPnDfMbpkt+R4NjoD6+fA8UJRFEBWqqM5GuK Ndhh1/gJ000NFhaYCYNrTr8oY0KQcj5kI98CfrLneZbd8uOqC55ADNRijbMIo/8bThTT NxQFYosJRMkP22n+ILHghZRyeMjpjrJBC+t5Lqw0v9za0zAVle6ECvvi/PWzPdsZoLF6 QiPGyMmP0JUNCM8GVB3+f5jZL6WRG98rZTfxU2pqZioonmBh5QdR/fiyT6EwXGQXOULp 3qKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BPwCBaM2/rXap2bK8yH+/+88XwXW6S6pZJPqaJg7YAk=; b=Wmht2cTcc/yC3p0Ipcl9SwH+H4Gur9eUmnN7F8xw++hQexh7a6BWSO6SlHSTbpdRvj F0CTTKZvayK11tGFJZc1fvJi9MZWLbRMR9Yeq8vihHHZRNr6fZJl6e/fneDrqW1H2yIy aYIRJ/1pvVjDWoF+oggbcnshmWG2gcK7eaKCUfsMszLcY+oDwNs7gEARNhkVdCK22mHY 5d/iqejJKHGN2FklNPNG4Fd+HtIsj4L9xix6Z+PlbTWprlfTVZAGKXBvQ2faEw9r38Ej 6kdr1iHRqY1KujlFXDU0kzoPQq+KFIIvXn1jowSm02c+0w+yMyrWW+OfKZXqWFqaJ7GH WPmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hg8S7OiT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si7886584edl.474.2021.06.17.14.30.52; Thu, 17 Jun 2021 14:31:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hg8S7OiT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231444AbhFQT7D (ORCPT + 99 others); Thu, 17 Jun 2021 15:59:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbhFQT7C (ORCPT ); Thu, 17 Jun 2021 15:59:02 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76204C061574 for ; Thu, 17 Jun 2021 12:56:54 -0700 (PDT) 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.