Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3686881ybi; Tue, 2 Jul 2019 11:43:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyewdGukP5tR+3Q9iL3l+iIZFiMuE4xUq139TymEVFgwUCmxqzAuHM0CQGHpBsrmVTyVzD+ X-Received: by 2002:a17:902:20ec:: with SMTP id v41mr34916787plg.142.1562093025421; Tue, 02 Jul 2019 11:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562093025; cv=none; d=google.com; s=arc-20160816; b=WFC4CgKM8s3nSunEmuUacd3VasqyeZZ9i3QwIse1euUBUxzmFOzUxWnuUs4FahhXFB dF0+CLZDoZJof5dGLRphrT40dE5ZcVb2wwn2pEeQyHQYo6pnOoxzTxfzJTIt3mci+INA 0ie6HuRqHfxNp97BxaEGTszYhzRwmKO3iII8LZzAzQtCnmbbTCMFcsiq2M7No8tNxRij iDoRFhwiu3L94MLeIpGDC7aEmAKz7cnRkattxV8KfLjwwSKtvKHIsNyFOpOSqfkJ2NFu qTzFjD9BJ/ptKYScrDvzQzgXX84FFsqHYyZ48b+savWTCzz2aGbOTrN7s151vcq43TQC lTYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=Nzn8p76p/fgRxeqGITZo8RFgd4g8QDrQeHiNX2X+zgY=; b=0akdJ19Wk6UJGtJPaxmbg6NOVFF8p/q5MmhGtkpEuNJsK4oBuCzWsn25DgSBzVOIDG tHOkX6GGBv4DNNk9Sny9dEoLA2bt59KDr4KL2LllYR96nK3dBRr1BlRCkA6EknoKpt9w vF9Pu4mzQEiPf3rfDVhI7aChqPfTxOu6O6uWVY5QIqBnQUVdlmLIgaCfcdZaNxbeCxNt qAb9jldotAssXCc1BsrUnjPkdtb/RsHJDaDhTsSQ2fDsMMx2/YPeqasjEHR4mJiSWKyR r0rhy0ypMp8YJIVPam9rcmb8x86Ojumm0P8tO9Mj45KgZXCAyD0FKFCsvVMy7pQ71VuA 0nHg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23si14567758pfo.168.2019.07.02.11.43.29; Tue, 02 Jul 2019 11:43:45 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbfGBSlq (ORCPT + 99 others); Tue, 2 Jul 2019 14:41:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57060 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfGBSlp (ORCPT ); Tue, 2 Jul 2019 14:41:45 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5141558E5B; Tue, 2 Jul 2019 18:41:45 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-160.bos.redhat.com [10.18.17.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7901A60C44; Tue, 2 Jul 2019 18:41:43 +0000 (UTC) Subject: Re: [PATCH 2/2] mm, slab: Extend vm/drop_caches to shrink kmem slabs To: Michal Hocko Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Alexander Viro , Jonathan Corbet , Luis Chamberlain , Kees Cook , Johannes Weiner , Vladimir Davydov , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Roman Gushchin , Shakeel Butt , Andrea Arcangeli References: <20190624174219.25513-1-longman@redhat.com> <20190624174219.25513-3-longman@redhat.com> <20190627151506.GE5303@dhcp22.suse.cz> <5cb05d2c-39a7-f138-b0b9-4b03d6008999@redhat.com> <20190628073128.GC2751@dhcp22.suse.cz> From: Waiman Long Organization: Red Hat Message-ID: Date: Tue, 2 Jul 2019 14:41:43 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190628073128.GC2751@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 02 Jul 2019 18:41:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/28/19 3:31 AM, Michal Hocko wrote: > On Thu 27-06-19 17:16:04, Waiman Long wrote: >> On 6/27/19 11:15 AM, Michal Hocko wrote: >>> On Mon 24-06-19 13:42:19, Waiman Long wrote: >>>> With the slub memory allocator, the numbers of active slab objects >>>> reported in /proc/slabinfo are not real because they include objects >>>> that are held by the per-cpu slab structures whether they are actually >>>> used or not. The problem gets worse the more CPUs a system have. For >>>> instance, looking at the reported number of active task_struct objects, >>>> one will wonder where all the missing tasks gone. >>>> >>>> I know it is hard and costly to get a real count of active objects. >>> What exactly is expensive? Why cannot slabinfo reduce the number of >>> active objects by per-cpu cached objects? >>> >> The number of cachelines that needs to be accessed in order to get an >> accurate count will be much higher if we need to iterate through all the >> per-cpu structures. In addition, accessing the per-cpu partial list will >> be racy. > Why is all that a problem for a root only interface that should be used > quite rarely (it is not something that you should be reading hundreds > time per second, right)? That can be true. Anyway, I have posted a new patch to use the existing /shrink sysfs file to perform memcg cache shrinking as well. So I am not going to pursue this patch. Thanks, Longman