Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp975505img; Fri, 22 Mar 2019 12:40:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyA0BCJ4/MWbGsZMu7OQ2zIK/CE7NkbgUPpi9aRJ0AuYL+ROvln7AlPbiHizYa+FuDC++uJ X-Received: by 2002:a62:47d0:: with SMTP id p77mr10714176pfi.95.1553283630034; Fri, 22 Mar 2019 12:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553283630; cv=none; d=google.com; s=arc-20160816; b=rGmJNhr7wNRb2Sap6N939squhC0YVm38O8bp1K1JZG7XvCOfVzzJg40FEXr4wXGCsf VoQmtBZkUddqncZakfhc+pjgN2vnWV/rKBX6BCjd0M6HTlOHb/9fifQay3KiNwHIF1bp wiapPi0Hm+mcPv0K1lhN84D+GQ2YEoKUobBBgv518L0+H0u4M+dceKBWq6D1i2VVhcff Fgix1G9O8K2Qa9OauAKlieUPpFgTFS/cAsirk/HNjCYLoNARZyH1Fb6gdpjUJS2nYJWQ f6rtIKuwMFXYaZtOVBDJwz8PU6g3kPJx93LpLn1ZQHjxBFAGh8vgc0C0UpiRfnWEIfvt ZCoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=+QFmd+qhN2DLA1/sywGPwInOJrjDW1Q9BEXsX4YZ2II=; b=XN+LXNjdPrGW2qtgfZb9L49F09UiMuNOwhOMqXTObSUtYFstB9L61nsotNRyBf0S51 BMQMur9YZruMEHfNFBwsDLLfAvyW2G9biae4MqlpgHnHJmJIutJXcnBQEi/y7y0idjXU IxcgREF0YvQoYkLIHKHhB3DbNzyIcvF2IEuIcmrorL52uTjEfzE7H1jv//FAqZQyHPd0 y6mnlSlgPpUeJ+fQVeWUX5rUOJSK7mEnUTFy17RvCjr5h+kGx55Aj5lcTXGY81G7C7OD yN23wJL8Um248u+kOa4k3Mb34Fx+MWx4Zi29kA0P6eHqnKMaaQjMR2VumQNgvRuJWF8M Db2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=iT0HBMtB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si7159162pgs.579.2019.03.22.12.40.14; Fri, 22 Mar 2019 12:40:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=iT0HBMtB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727174AbfCVTjc (ORCPT + 99 others); Fri, 22 Mar 2019 15:39:32 -0400 Received: from a9-112.smtp-out.amazonses.com ([54.240.9.112]:48246 "EHLO a9-112.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbfCVTjc (ORCPT ); Fri, 22 Mar 2019 15:39:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1553283571; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=+QFmd+qhN2DLA1/sywGPwInOJrjDW1Q9BEXsX4YZ2II=; b=iT0HBMtBFw2zX7vPdC/3Hsd9GGDeJyPy6RlxeEJUJszYMDjDulBgegdH876HD3qC BOgjqXiznIZnV3+Sj6z/nBaQCINjevkXajnbsdePLIenCSkdZj3ReRNlcgKJsKNchHb LLL7D9EhkY/3zv0B+S6iFEINleSK1wksxGKy3K9Y= Date: Fri, 22 Mar 2019 19:39:31 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Waiman Long cc: Oleg Nesterov , Matthew Wilcox , Andrew Morton , Pekka Enberg , David Rientjes , Joonsoo Kim , linux-kernel@vger.kernel.org, linux-mm@kvack.org, selinux@vger.kernel.org, Paul Moore , Stephen Smalley , Eric Paris , "Peter Zijlstra (Intel)" Subject: Re: [PATCH 2/4] signal: Make flush_sigqueue() use free_q to release memory In-Reply-To: <93523469-48b0-07c8-54fd-300678af3163@redhat.com> Message-ID: <01000169a6ea5e46-f845b8db-730b-436e-980c-3e4273ad2e34-000000@email.amazonses.com> References: <20190321214512.11524-1-longman@redhat.com> <20190321214512.11524-3-longman@redhat.com> <20190322015208.GD19508@bombadil.infradead.org> <20190322111642.GA28876@redhat.com> <01000169a686689d-bc18fecd-95e1-4b3e-8cd5-dad1b1c570cc-000000@email.amazonses.com> <93523469-48b0-07c8-54fd-300678af3163@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.03.22-54.240.9.112 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Mar 2019, Waiman Long wrote: > > > >> I am looking forward to it. > > There is also alrady rcu being used in these paths. kfree_rcu() would not > > be enough? It is an estalished mechanism that is mature and well > > understood. > > > In this case, the memory objects are from kmem caches, so they can't > freed using kfree_rcu(). Oh they can. kfree() can free memory from any slab cache. > There are certainly overhead using the kfree_rcu(), or a > kfree_rcu()-like mechanism. Also I think the actual freeing is done at > SoftIRQ context which can be a problem if there are too many memory > objects to free. No there is none that I am aware of. And this has survived testing of HPC loads with gazillion of objects that have to be freed from multiple processors. We really should not rearchitect this stuff... It took us quite a long time to have this scale well under all loads. Please use rcu_free().