Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2352740rdf; Mon, 6 Nov 2023 11:28:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOEhFl493qXuS2Xb0CruUBZfsIf36SqIQ2LMriTV/nzqnPxFxbq9QHElb5z9qJSHJ79XvD X-Received: by 2002:a17:903:11c3:b0:1cc:5549:aabd with SMTP id q3-20020a17090311c300b001cc5549aabdmr23689633plh.8.1699298924649; Mon, 06 Nov 2023 11:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699298924; cv=none; d=google.com; s=arc-20160816; b=xFO/IfCOqLIl0/zBRVADKAb15CLR+VEbKsB1gNxDjhtm29brbnohf0tehzEf/ULGrT HOBY4txYMijLItbYR3ovFCl3Xmvso8WY1hH9Bbr3Lt8Cok0OQ0vl+GA+8Yf5GA7IX7z+ cR0wiDKoYqCGNDPb0d3BUJHsEprGpAgMiE54THh1bOF5MrsqFP64rA0eeliCeXq77+TS 932DHPanOQagoBRUVamCXbNePAdlEhUhUk/62kLOskkiGjvJOnmzZFFI3Mf394dUTmbd pG3qDkSMZfTuSwR63dUN6iLYbrvGUaxOlMYXtpwCCpB+XTP1aK0N8wm+EUHoPlwMS8bk Y0ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mlzvkAJRzuQZnUx9+U36N20af1pAsethgx21gTjo+4o=; fh=U2rnEkZWA33oK60kFemTyUmMccGhth5xszNUs8P/aDI=; b=NvPnhDBt5OOXfieDQuwZoG27JSRC6QwllGyAmZ/IsxjxZVW+xNxoP5PaxonTkfbwUR 19QvWPX7UFRgpAIOiTkB1j1zP/BS8jj0oss096HQrz8u2j70g931ALQaSmPaUPMGws7d o9kV5zu5g6pJSu6yvHwpgPIV+IWjiwblAdrcJlq9HQY1kl0fO17n0R6JT3HHnO2WtnBD ujiePRf0y/olt1TipIrBJjZMyHZNhsE6XMBoT7c7B9rAClLWnT8tD9EEaVeo23GCbNQD t5M4foD3o/ufACZirDai8ubpdczZPCgHspzPhxdOe11xc+EoayUzCjy/651JP3ti2gOM F3bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=brfH2M5w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id j12-20020a170903024c00b001c61a231d33si9233908plh.292.2023.11.06.11.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 11:28:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=brfH2M5w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 36FA48033199; Mon, 6 Nov 2023 11:28:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232213AbjKFT2d (ORCPT + 99 others); Mon, 6 Nov 2023 14:28:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231555AbjKFT2c (ORCPT ); Mon, 6 Nov 2023 14:28:32 -0500 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ADA698 for ; Mon, 6 Nov 2023 11:28:29 -0800 (PST) Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6ce2ee17cb5so3157221a34.2 for ; Mon, 06 Nov 2023 11:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1699298908; x=1699903708; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mlzvkAJRzuQZnUx9+U36N20af1pAsethgx21gTjo+4o=; b=brfH2M5wBYZXqLt4JinyWrWM+NPX/Ps9+Jy08MnkU0W5VQJ7ayOOhtzEK/v3SfBj9Z caNi45PXXQzHixZRujGuNYuWjtolBMTdBkCZKmGw8lJtGgBamyIq/7snaHbHhTVYniYZ 7gwB1onEiMR/BFQgASFgwsPQ2oWtRS7GOK1Z9zvXfOHeDg/yLIa7iR1WrOo8hHl7bQcZ 5tIzvDQhYhLCchyd34MbWGl4xraypnen3AiPa1HMRVGxZwAF/hGMfGST+BOUT+bi/4y5 oQUzq8HxjwHOjVCis2HbOpgLz+s+UfJy77CYqicTZvWpEHNE9h4T8vGUuK0oK1wcypvm nFwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699298908; x=1699903708; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mlzvkAJRzuQZnUx9+U36N20af1pAsethgx21gTjo+4o=; b=ZefW4nV9JYWozFM2UXW6K1mN188hRRY5GN3os5xj8twcLvGXUL0/Jx8fTafThRpVxx BNEuHIo0yVx4kdVL2QG6DKgM6DPCHCO1AlluBTzlFicvp610kCQXQQty/1MQFpDqloFi PqVv4vXoF31WVTRJ4ACnPCw5tApRfFk1rQIyzCIToJO3d7L9A3wl4QHyqOaY2AdDq5wb d13x639FKcEY5i1Euklz6tbjVpKnHss06h8HUtVKEoqkqgEGuXiePwJsy7ffSckpQg6Y 1FL9le1t55j5ybgnO6KfkUA/IcFu/ofF/9lyEGkpDaNzwRHoXIz2gfu3M2V5HjRd58b7 2vmw== X-Gm-Message-State: AOJu0YxXcdfW2lEuhCfnkGELsdpkDB05XjfplDUMk61ZuiOC6W4YNAyB JqGHb/rqINWHD2VfBCibMNjtFg== X-Received: by 2002:a05:6830:2b2a:b0:6d3:1f3e:4c4 with SMTP id l42-20020a0568302b2a00b006d31f3e04c4mr19267202otv.0.1699298908462; Mon, 06 Nov 2023 11:28:28 -0800 (PST) Received: from localhost ([2620:10d:c091:400::5:86b7]) by smtp.gmail.com with ESMTPSA id jy5-20020a05622a818500b004181b41e793sm3660625qtb.50.2023.11.06.11.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 11:28:28 -0800 (PST) Date: Mon, 6 Nov 2023 14:28:27 -0500 From: Johannes Weiner To: Stefan Roesch Cc: kernel-team@fb.com, akpm@linux-foundation.org, riel@surriel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v1] mm: Fix for negative counter: nr_file_hugepages Message-ID: <20231106192827.GA3661273@cmpxchg.org> References: <20231106181918.1091043-1-shr@devkernel.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231106181918.1091043-1-shr@devkernel.io> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 06 Nov 2023 11:28:42 -0800 (PST) On Mon, Nov 06, 2023 at 10:19:18AM -0800, Stefan Roesch wrote: > While qualifiying the 6.4 release, the following warning was detected in > messages: > > vmstat_refresh: nr_file_hugepages -15664 > > The warning is caused by the incorrect updating of the NR_FILE_THPS > counter in the function split_huge_page_to_list. The if case is checking > for folio_test_swapbacked, but the else case is missing the check for > folio_test_pmd_mappable. The other functions that manipulate the counter > like __filemap_add_folio and filemap_unaccount_folio have the > corresponding check. > > I have a test case, which reproduces the problem. It can be found here: > https://github.com/sroeschus/testcase/blob/main/vmstat_refresh/madv.c > > The test case reproduces on an XFS filesystem. Running the same test > case on a BTRFS filesystem does not reproduce the problem. > > AFAIK version 6.1 until 6.6 are affected by this problem. > > Signed-off-by: Stefan Roesch > Co-debugged-by: Johannes Weiner With the newline fix Willy pointed out, and CC: stable: Acked-by: Johannes Weiner