Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3271612pxa; Tue, 25 Aug 2020 16:56:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY1mD2zJI7Q+qsmSqd/7y1+O1PfOZ3T//5aZ/YlCh36XNHje6G8yQrjhaVZZpHicXBSh5d X-Received: by 2002:a17:906:2a04:: with SMTP id j4mr13834447eje.440.1598399779137; Tue, 25 Aug 2020 16:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598399779; cv=none; d=google.com; s=arc-20160816; b=Trw6rc0H0CKayewgya6P36kLaSTn5aFIHZ/iHPk/dD21Trb8ew7w1bDZULoQEfKgms /Y9WqXy6o+n55RJ10CmewbU8L1K0vvc0uLycqmGUuBi8biIKQ5i5alD7he7gLUfQvs38 jP9Tum9iCRBzgMzC07mnVO5M6b6WEXn/NdfhVGJNmvFRvIzyKu9g3oovQHzisrfPufVB S0ACQvkdO0hsyXusUG2zQCuD/0hyoI6x5pgzbF6zBUMcNKiqUXuoMXZ55SFbouWokHBP fdMjq/QYwrk0EiXyyNk+FKdC25riFYPQYbzg7vysSuabqLZ5ycJKA8kw4pymK+NUE45t bX1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=7sjuDNKoNuivCO4m9qTc9EZF7ep9JNUbpUXkfmM2aDw=; b=xGjkgqq1pT1Nx7ClZdH0U1AkKmfDDnlWMRIPRRYzhtg+OgKVjyjKeniFSkYBhbUXXe JtYsPGMEPKSmFxeOPSyi4qKnWDa3bEyU4UZer6d2xat0Vm6otKM/JxtHXMPrnFdH/2iz GV8SbwQhRkouGf2EoZIrRO4bNFWF2i64sfFdkxBZR+0+sivB75CUGdngJUJ3BjNoon9a t8N31fdIxgXG4OcqP0wx1svlXM8hcMfo7HvouCuV3o+WDtm99AkgMe8o4p4hpTvmmrZ2 3+6L/bQaQJrE3fz/GLW5qF4kpMRVAJYWa98u50glR66hRWu+pgW1ehObtDhzTkdvMQ9i 451w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BmPGkWsX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=K9FyjbVp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bq8si416420ejb.282.2020.08.25.16.55.56; Tue, 25 Aug 2020 16:56:19 -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=@linutronix.de header.s=2020 header.b=BmPGkWsX; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=K9FyjbVp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726599AbgHYXxJ (ORCPT + 99 others); Tue, 25 Aug 2020 19:53:09 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:53484 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbgHYXxI (ORCPT ); Tue, 25 Aug 2020 19:53:08 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1598399585; 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: in-reply-to:in-reply-to:references:references; bh=7sjuDNKoNuivCO4m9qTc9EZF7ep9JNUbpUXkfmM2aDw=; b=BmPGkWsXSKuh5VPNK7AWgRiGjag/CK7IsyxCGihen0mv9vcZDteoHb6lLcWJvg+QdUq4Jz GWZLrSFsh2aNtMZCzRWGq81KJBlIiA6GyDFvrW1qZwySjylyELvAaGBNgZq9qGTaPgxnqr yzS5mh+e5dw0EBxmWfRPFWvwzAPdvQBjNHpUwjjMNL6LdQBHtoBJniVPp2nLkFliIIj99B Iy3Mf8vM0jSdgYcmcZemfsrovl9aeTGn50WOVeHgWsgYrUsrS2YxPoKA52F5SGu+cN7sHJ QsbRd/kaesAZ3Z5600k6TX/KHp6FfMDpqif9hW1TcA2uRv09n+LP3/Qrd8os9g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1598399585; 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: in-reply-to:in-reply-to:references:references; bh=7sjuDNKoNuivCO4m9qTc9EZF7ep9JNUbpUXkfmM2aDw=; b=K9FyjbVpbd79OT5j9MBsQvctnOvFrtlSWGudMTaH3o6wHWDyzci4iQodpIOgIRBey2eIt+ 7xPoKllDsjo0uYCw== To: Waiman Long , "Zhang\, Qiang" , "elver\@google.com" Cc: "linux-kernel\@vger.kernel.org" , "akpm\@linux-foundation.org" Subject: Re: =?utf-8?B?5Zue5aSNOg==?= [PATCH] debugobjects: install cpu hotplug callback In-Reply-To: References: <20200820032453.5222-1-qiang.zhang@windriver.com> Date: Wed, 26 Aug 2020 01:53:05 +0200 Message-ID: <87pn7ewae6.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25 2020 at 18:26, Waiman Long wrote: > On 8/25/20 12:53 AM, Zhang, Qiang wrote: >> >> When a cpu going offline, we should free objects in "percpu_obj_pool" >> free_objs list which corresponding to this cpu. > > The percpu free object pool is supposed to be accessed only by that > particular cpu without any lock. Trying to access it from another cpu > can cause a race condition unless one can make sure that the offline cpu > won't become online in the mean time. It is actually safe because CPU hotplug is globally serialized and there is no way that an offline CPU will come back from death valley magically. If such a zombie ever surfaces then we have surely more serious problems than accessing that pool :) > There shouldn't be too many free objects in the percpu pool. Is it > worth the effort to free them? That's a really good question nevertheless. The only case where this ever matters is physical hotplug. All other CPU hotplug stuff is temporarily or in case of a late (post boottime) SMT disable it's going to be a handful of free objects on that pool. As debugobjects is as the name says a debug facility the benefit is questionable unless there is a good reason to do so. Thanks, tglx