Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6453579rwi; Mon, 24 Oct 2022 01:21:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6FDdnLjprbLkeRRI6/3C0EFZ9sb0hz5MxlP/i1VMr1UPU+kRwSVmNpergZSL67wzSokRxL X-Received: by 2002:a17:907:7611:b0:78d:9d69:adf9 with SMTP id jx17-20020a170907761100b0078d9d69adf9mr26819495ejc.283.1666599676616; Mon, 24 Oct 2022 01:21:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666599676; cv=none; d=google.com; s=arc-20160816; b=NYR8VnJ7gEUtlwYd894FHrwsffC3nTC+5o2L3g64dKggaEF30d87Xhn+m3h61+SH/n jqmujYuSXGG46J90B1dVJBJGotRPfRsOFRX/j31JNut3PtiVrv1g0e2XFjGl/tBSoDYt 9WOGJuNjeJJ1AAHRR7KWil/2TkKgmDah9qQigNBcj4KIB2l+LSrmiMM5xN0NN/MXJA1N XA0Ktp5xEWkF1ouP48Yiq7CmDBdCVbQgFixUeTuGUSnXGCEcFPEw+5/fB8J1W107UlqY xklCU3q2dyVlPNVXq52yaHEJZrqTZlKMvVVTCmJ+zQedhfpaPwl27QE8innB8uQiFIKO 69OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EBzRuKDFM+71l7c7xLrT1+dLyWIbjD2WVMOLNE3ePAk=; b=d9UTLufp3qJJINKTX9w2nRK6riYD+98MKeer9tQy3ekYTPUoCbFhQgS5LiMCN1OJUZ UbL3IpBVDcM/HP7Gdae2tPNjPnTODpLHrYrZu3SJ4fgENaiaFdjnIKmQ6t4aAGP2YGwM T2sllUvnXD0i9smi3Z8dr7cvHPOj89gniQ1E5aZIxan5mMOGlJmSrf4DLMESa+nsL1Tw otag2+UXcBhjLOk9h3+g5e+WOsXngEXIlymSnK9oWDoLtg2HEtngpbUNPsX6VmjXKd/F uA3ve7IfsiQ4qR4HZF8x40VmctG2peO/yrd8OhlwASm2vnR6PFw+X92v0kksn2Q1R/61 v+2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MnHAroaT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs23-20020a1709073e9700b0078dc5e684cbsi29335210ejc.462.2022.10.24.01.20.51; Mon, 24 Oct 2022 01:21:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MnHAroaT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbiJXIQh (ORCPT + 99 others); Mon, 24 Oct 2022 04:16:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbiJXIP6 (ORCPT ); Mon, 24 Oct 2022 04:15:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5E9F43313 for ; Mon, 24 Oct 2022 01:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666599299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EBzRuKDFM+71l7c7xLrT1+dLyWIbjD2WVMOLNE3ePAk=; b=MnHAroaTc6RrPXwsH+QgEgbPO/IJ4eawdOfFKdlWRoCGChSg7ldSANu9OvDV1a4FRfIBMb /4RuK75ADJukCxSS94O85pzOPrWX0aYWUUOi49Z+RrVGvSS5ZNWSqSdAtSXEJYLUzwtTfb CeqvxxJjhMwyfN4tQ2L61PHS0YmxfdQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-127-SP0uFmoMOeuzBev62VLccA-1; Mon, 24 Oct 2022 04:14:55 -0400 X-MC-Unique: SP0uFmoMOeuzBev62VLccA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 94E3D1C05132; Mon, 24 Oct 2022 08:14:54 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-35.pek2.redhat.com [10.72.12.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F37140C6F75; Mon, 24 Oct 2022 08:14:51 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: Dennis Zhou , Tejun Heo , Christoph Lameter , Andrew Morton , linux-mm@kvack.org, Baoquan He Subject: [PATCH 3/8] mm/percpu: Update the code comment when creating new chunk Date: Mon, 24 Oct 2022 16:14:30 +0800 Message-Id: <20221024081435.204970-4-bhe@redhat.com> In-Reply-To: <20221024081435.204970-1-bhe@redhat.com> References: <20221024081435.204970-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The lock pcpu_alloc_mutex taking code has been moved to the beginning of pcpu_allo() if it's non atomic allocation. So the code comment above above pcpu_create_chunk() callsite need be updated. Signed-off-by: Baoquan He --- mm/percpu.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c index a3fde4ac03a4..a8121302a79c 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1817,16 +1817,12 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, spin_unlock_irqrestore(&pcpu_lock, flags); - /* - * No space left. Create a new chunk. We don't want multiple - * tasks to create chunks simultaneously. Serialize and create iff - * there's still no empty chunk after grabbing the mutex. - */ if (is_atomic) { err = "atomic alloc failed, no space left"; goto fail; } + /* No space left. Create a new chunk. */ if (list_empty(&pcpu_chunk_lists[pcpu_free_slot])) { chunk = pcpu_create_chunk(pcpu_gfp); if (!chunk) { -- 2.34.1