Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3720659ybv; Tue, 25 Feb 2020 06:14:19 -0800 (PST) X-Google-Smtp-Source: APXvYqz899LdNv3ZSxi9BDdFjkGutUZ85LP5Zl1oMUUqMXnOnOrOrO3f5awPhf/Zhl4UdJBYzC6o X-Received: by 2002:a9d:865:: with SMTP id 92mr21124707oty.6.1582640059715; Tue, 25 Feb 2020 06:14:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582640059; cv=none; d=google.com; s=arc-20160816; b=iflfdw1qyZ0PepmLqkjVPSarwYFCB+3I0FU3D6MNapKGHBiRKiBFp4eFCQEAY4CLHw zz5CApsg/mvEiH3Eh1FMrW3v0qtrkMvuELfK5uH+lKu1KjGt5JHLdwD/aLXVuM6uUr2C S4C5NDEbFV8dOssFnTjr7Ka14LyvjPJWU/3UIstlAvHca/YJ8pl4+dcXwZFVqMj3kNUq 48dSxjqGweCwEeW0u9hdxZz/+5fItBFafx5/bkFiGAPP2GptbiG837cQGmjBCLxJNdzx 72KZ130jcdzgSB1iAbL9Rt8MDpXNn6R9FLQ5By//XiQXPPLTSzDA7DoAI7knSgobCu9a lk9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=jxubRze50o1F8gM76cssrAcVTC+kj7bPygK0ClbrEFQ=; b=kWGzGbQdRm/6hNdxtM0a/hancC/UXUix2c4ZBJZ1Tq9h6oWfsp6yCC1By+eXTa+TiT URN6TbvvvxgNkKM0YezD3ft2bPw1aDbRgeWfshIHkmRVk1RfTsNLtGQN2JjbKlZHuQcv mypgFsyym+DCzZRAvXXTcDTtb2+1Z3g12Q7CGTm3hx9foJC2/w75I5DeivRUzJbTJRz8 OrUkMxQX3aaWyvw9K+HNrSu8pJltboCGh3elvTSyXZ7uA2HLcgggn26BYJ4u3/m4f3eY rafsQZ2XRyeRbY2OcrtA0hF1u+JGhX26wnORN6HPCR13Z3J4/8hAZrC/EXj1icpJGXYM 1TEw== 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 c130si7069637oib.182.2020.02.25.06.14.06; Tue, 25 Feb 2020 06:14:19 -0800 (PST) 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 S1730604AbgBYONo (ORCPT + 99 others); Tue, 25 Feb 2020 09:13:44 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45526 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730478AbgBYONo (ORCPT ); Tue, 25 Feb 2020 09:13:44 -0500 Received: by mail-wr1-f66.google.com with SMTP id g3so14864417wrs.12; Tue, 25 Feb 2020 06:13:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jxubRze50o1F8gM76cssrAcVTC+kj7bPygK0ClbrEFQ=; b=BZ8YTJ5QErOJ/y+jWt4D7dZix2s5LSqv9Mv10h+54eL+2avNFQYA9zenWsdvxayHa6 sarBknWHzQvqcd6+4SeczyEULQlA1O4RzUBjBLkYUWyh95J7OWazHQZ05C9VJ2yHqDVb qD2CvNn3ZDw5DLOfptoMQpYGDnuffoWAm0HsCRF8sPW+swsoUcMe3gEJalR/zlxuEmLo NMJVO/PfQ8jOtJcKz3k/DWxpISbsPFPGf2Lw0/ojhLq8JAPelyx8y0LVvztttpYcaZw9 FpbUnlhWfF8ckKm3k3hE8L8lr5PJ0+SavrA6eneKZ+et/YUbbNy/ovZghuqyA4n8CRwN t5gg== X-Gm-Message-State: APjAAAU+FQgAnm9qoaXRRKben0d/48wW808hTqdHfWQDEPXIyjL5dfz/ dxKJGpUk2FqSaCUzbF/0/hs= X-Received: by 2002:a5d:55c1:: with SMTP id i1mr79044434wrw.347.1582640020664; Tue, 25 Feb 2020 06:13:40 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id b10sm4161691wmj.48.2020.02.25.06.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 06:13:40 -0800 (PST) Date: Tue, 25 Feb 2020 15:13:39 +0100 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, Andrew Morton , "Michael S . Tsirkin" , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH RFC v4 11/13] mm/vmscan: Move count_vm_event(DROP_SLAB) into drop_slab() Message-ID: <20200225141339.GV22443@dhcp22.suse.cz> References: <20191212171137.13872-1-david@redhat.com> <20191212171137.13872-12-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212171137.13872-12-david@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 12-12-19 18:11:35, David Hildenbrand wrote: > Let's count within the function itself, so every invocation (of future > users) will be counted. > > Cc: Alexander Viro > Cc: Andrew Morton > Cc: linux-fsdevel@vger.kernel.org > Signed-off-by: David Hildenbrand Slight inconsistency with the page cache droppint but nothing earth shattering. Acked-by: Michal Hocko > --- > fs/drop_caches.c | 4 +--- > mm/vmscan.c | 1 + > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/drop_caches.c b/fs/drop_caches.c > index d31b6c72b476..a042da782fcd 100644 > --- a/fs/drop_caches.c > +++ b/fs/drop_caches.c > @@ -61,10 +61,8 @@ int drop_caches_sysctl_handler(struct ctl_table *table, int write, > iterate_supers(drop_pagecache_sb, NULL); > count_vm_event(DROP_PAGECACHE); > } > - if (sysctl_drop_caches & 2) { > + if (sysctl_drop_caches & 2) > drop_slab(); > - count_vm_event(DROP_SLAB); > - } > if (!stfu) { > pr_info("%s (%d): drop_caches: %d\n", > current->comm, task_pid_nr(current), > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 5a6445e86328..c3e53502a84a 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -726,6 +726,7 @@ void drop_slab(void) > > for_each_online_node(nid) > drop_slab_node(nid); > + count_vm_event(DROP_SLAB); > } > > static inline int is_page_cache_freeable(struct page *page) > -- > 2.23.0 -- Michal Hocko SUSE Labs