Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4124881ybg; Fri, 25 Oct 2019 13:43:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjT/8NHbtbyY2JgtaSlOjzsA+St/9Zh7NpOu3oFoYeX83BRTOduoZz1iGax2HptzCadbaM X-Received: by 2002:a17:907:20f3:: with SMTP id rh19mr4141293ejb.289.1572036210762; Fri, 25 Oct 2019 13:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572036210; cv=none; d=google.com; s=arc-20160816; b=Evti3VjeYTIH3oaC9BdPsCmGawB9FJMx/AwRke8UfOTEE3Bd7b3ekZMLwWVlJVY4+/ QkVWnPEM08jICMCTVUwRsGpLkDX/BogF1/CpZUU2/f1lQyMbqULCiK6ZvMkqBBs9PXpL kFGcjmZLNbrn+MmWdtUTQrLX+a09Gh/wgqfXZZd6Jy5szPMr3Vju74/5u6Z2bXD17rcx dAczgm3qe2AQFFiiIise7pRmaeYW+8sr0XeoJWF8Jo5Ehf401q3vKXahoA1gqdgvUxzy jjc+tFMyPKhLDvZwdJS2Hguwvpvkj/VmrMKhtvJph/x4j7SGkkhN3J23nxwJXh0bn2xR TU/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=eRR8iVcnTeg+a/PW1as5MGnQvZxSbiKNkPvq/iUfeIY=; b=z26y5xQAebWZ9re4jY1fghFSudiq4f56A91FXDJOvCl3ZR7oUGUzh0fcbptNHZ0/Xr yhS/RynMKAL8w+PAe/Q12ZLrVJ+QANHIyKZnszOrC8c0eWrhpY6GDGjbVUZXYGMTYyQq 48z5cIh78FXj/KQ3aX3eXPgnZEDfedU/PgrtDxTuBmJ4nXjG+TLeHMnopOIOzqB57vhA jHVtP7bS58eOGJuRbDwf/iNtQRbQw6uznV5UhVEgqCVRugSyUjDFLsn9JPOrCIQkPGRW hfhLD6HeDn4aVDC9kG4FbDOa21AvrKrA8Xwp1/6qqtE0bsLdRUpJkPVqGaQJU5L9mTdV SE/w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r9si1865148eju.251.2019.10.25.13.43.07; Fri, 25 Oct 2019 13:43: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; 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 S2504006AbfJYQF2 (ORCPT + 99 others); Fri, 25 Oct 2019 12:05:28 -0400 Received: from 12.mo4.mail-out.ovh.net ([178.33.104.253]:42383 "EHLO 12.mo4.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393851AbfJYQF2 (ORCPT ); Fri, 25 Oct 2019 12:05:28 -0400 Received: from player718.ha.ovh.net (unknown [10.108.54.38]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id B9CE020D69F for ; Fri, 25 Oct 2019 17:49:52 +0200 (CEST) Received: from sk2.org (gw.sk2.org [88.186.243.14]) (Authenticated sender: steve@sk2.org) by player718.ha.ovh.net (Postfix) with ESMTPSA id 14749B568AE5; Fri, 25 Oct 2019 15:49:48 +0000 (UTC) From: Stephen Kitt To: Alexander Viro , linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Stephen Kitt Subject: [PATCH] Allow disabling drop_caches logging immediately Date: Fri, 25 Oct 2019 17:49:16 +0200 Message-Id: <20191025154916.18431-1-steve@sk2.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 1846475850815655406 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrleefgdelgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, echoing 4 to drop_caches disables logging for subsequent operations, not the current operation, even if the write is combined (echo 7 ...). This patch takes bit 2 into account before logging, so that logging can be disabled concurrently with other operations. This doesn't change the behaviour for existing scenarios encountered in the wild. Signed-off-by: Stephen Kitt --- fs/drop_caches.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/drop_caches.c b/fs/drop_caches.c index d31b6c72b476..2562d6285ce4 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c @@ -65,12 +65,12 @@ int drop_caches_sysctl_handler(struct ctl_table *table, int write, drop_slab(); count_vm_event(DROP_SLAB); } + stfu |= sysctl_drop_caches & 4; if (!stfu) { pr_info("%s (%d): drop_caches: %d\n", current->comm, task_pid_nr(current), sysctl_drop_caches); } - stfu |= sysctl_drop_caches & 4; } return 0; } -- 2.20.1