Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2983512ybd; Fri, 28 Jun 2019 00:32:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyi5he0z2ZJSDibL5vD+swBcqr4ZwHqqQvWWiq8/OKK+dACnTGMHF9+zBwKf8p23eqz/xu X-Received: by 2002:a17:902:7d86:: with SMTP id a6mr9751909plm.199.1561707157319; Fri, 28 Jun 2019 00:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561707157; cv=none; d=google.com; s=arc-20160816; b=f3wii4gh3NKISf1UR7ucrnuZfo503DYnEBePFsETwcpiWLYKHH19v6+Kj5FnyswwGg uCxLtpSevVxGDqlGfYx9w9M9wu5/mw9h3r1ruD6Tbv9of2gNacY0WGzAouiytZ0JQmHF XXqBcIsNBNlXtWBWbZx2tqFKZBy0snZ2hMtuuElxM8sVN1HchSc+oyNo3P9jU0YIBnna BnTT76pIuxxudVxpgmrLiZ97qj7FRWJ4xyzqzvLc004ZeDMA6ZGtV11QpAlcNHCMZe0F 3wYYhbgSBvGoDk5qUamS5TEkpXYlpKdOSBW8frMyOJOStSlbbuJbHykEHU0ZSH8cerw4 Q7/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XeQouqUJAzpEqvuzyif/2fBCLtdFeOZ7ChHqCkDtlwM=; b=W1EP++YNmIvWyU2R1uWNz8uVdmezdtxiulaz7sffO0emypFOeUcZzpddgouerneHqo gBFSctOVhwCO5MFdmfEJy56uOrsrV5MpW3D5cSCbD50zUoCiJRa+UCZvQnCaitd5WXmJ 6xpyXT5UZnAUUBhYNtgFhupoQpXEXuriNwSfr62yseyjurlNCU4YN4x9PvyHukHaLDFR hZPGB64yfToizS4HyeKCub8EIs5s52Rw8k2s5EJ199EmGSgFPHz29pjc0U60U3WAk7XL yhV5o48tMPEL+esrV2506yB+AXfaC7zq08ZdF5C+n/Un0mSlyOYG3zWA3yrlxwtdpp5A BEHA== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bh8si1382829plb.175.2019.06.28.00.32.21; Fri, 28 Jun 2019 00:32:37 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbfF1Hbd (ORCPT + 99 others); Fri, 28 Jun 2019 03:31:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:32908 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726426AbfF1Hbd (ORCPT ); Fri, 28 Jun 2019 03:31:33 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D3DF7B167; Fri, 28 Jun 2019 07:31:30 +0000 (UTC) Date: Fri, 28 Jun 2019 09:31:28 +0200 From: Michal Hocko To: Waiman Long 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 Subject: Re: [PATCH 2/2] mm, slab: Extend vm/drop_caches to shrink kmem slabs Message-ID: <20190628073128.GC2751@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5cb05d2c-39a7-f138-b0b9-4b03d6008999@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)? -- Michal Hocko SUSE Labs