From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8815347505 for ; Mon, 13 Jul 2026 20:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783973825; cv=none; b=Ti2BTFCCzWaoaiGb+eeGjKprgEBq0MgW5WGgeTgLooTJd/jybfZtjePpxqkUFRfHeVCP0rGoTY0gK8gd33CLJbIZqVoSvMxq8ND0wbDA2Q2OP0ce+OShRSQwdKUbFBUMl4twXuojV9lzMSQA9bBZ6MaByOwceSyqSalLzb7i3wM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783973825; c=relaxed/simple; bh=EmhcviqChrJ+ElQpwHDoM6viQdDrEce/DZlRQHVNyWU=; h=Date:To:From:Subject:Message-Id; b=ETIyl10CLBfh5XxAnbhKAdpb2GDoJ/J+LYPLp+caWxBZ0hp0ad3ecNCrMAA75l85jiXMYe0+esS5q86YXluxtJepZEgaJwn2IsJZp35T9dtGgzPhOkshAAxADqDspj5aXCgzGCqNH3rx41eKf1WxqZkFk+Sg+matEnLki0LqsAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=d7r0z+3J; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="d7r0z+3J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 832CA1F000E9; Mon, 13 Jul 2026 20:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783973823; bh=I2yVnTTOQoQ+jhDUj/6HeSvN3ExogfJUVSYsgb4O0y4=; h=Date:To:From:Subject; b=d7r0z+3J/6A4D8AEUQPEzJ/y26R0+Ws49oDfoGCiJsmlsnV5XUV45nuu8kOlpyBWR W037iF0T4EYkEWsJtTh4opnN3sBZasd1xD3V/u4kA15muIfZ8wFJmG2qPUS9sP8Tk3 D6+kDj3EvaXxzaLHfZTeXgAB3Arn49/hWOuk7+2w= Date: Mon, 13 Jul 2026 13:17:03 -0700 To: mm-commits@vger.kernel.org,youngjun.park@lge.com,shikemeng@huaweicloud.com,nphamcs@gmail.com,kasong@tencent.com,chrisl@kernel.org,baoquan.he@linux.dev,baolin.wang@linux.alibaba.com,baohua@kernel.org,hch@lst.de,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-vmstat-add-nrswpinout-counters.patch added to mm-new branch Message-Id: <20260713201703.832CA1F000E9@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm/vmstat: add NRSWP{IN,OUT} counters has been added to the -mm mm-new branch. Its filename is mm-vmstat-add-nrswpinout-counters.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmstat-add-nrswpinout-counters.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Christoph Hellwig Subject: mm/vmstat: add NRSWP{IN,OUT} counters Date: Mon, 13 Jul 2026 11:33:44 +0200 Count how many swap I/Os we cause. Due to batching this can be different than the current counter number of pages written/read, and tracking this information is useful to see how efficient the batching is. The counters are added at the end of enum vm_event_item and the vmstat_text array under the assumption that the order of fields in /proc/vmstat is an ABI. If that is not the case, they could be grouped with the other swap counters. Link: https://lore.kernel.org/20260713093350.2154226-8-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Nhat Pham Cc: Baolin Wang Cc: Baoquan He Cc: Barry Song Cc: Chris Li Cc: Kairui Song Cc: Kemeng Shi Cc: Youngjun Park Signed-off-by: Andrew Morton --- include/linux/vm_event_item.h | 4 ++++ mm/page_io.c | 2 ++ mm/vmstat.c | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) --- a/include/linux/vm_event_item.h~mm-vmstat-add-nrswpinout-counters +++ a/include/linux/vm_event_item.h @@ -175,6 +175,10 @@ enum vm_event_item { PGPGIN, PGPGOUT, PS KSTACK_REST, #endif #endif /* CONFIG_DEBUG_STACK_USAGE */ +#ifdef CONFIG_SWAP + NRSWPIN, + NRSWPOUT, +#endif /* CONFIG_SWAP */ NR_VM_EVENT_ITEMS }; --- a/mm/page_io.c~mm-vmstat-add-nrswpinout-counters +++ a/mm/page_io.c @@ -704,6 +704,7 @@ void swap_write_submit(struct swap_io_ct { if (!ctx->sio) return; + count_vm_events(NRSWPOUT, 1); ctx->sis->ops->submit_write(ctx); ctx->sio = NULL; ctx->sis = NULL; @@ -713,6 +714,7 @@ void swap_read_submit(struct swap_io_ctx { if (!ctx->sio) return; + count_vm_events(NRSWPIN, 1); ctx->sis->ops->submit_read(ctx); ctx->sio = NULL; ctx->sis = NULL; --- a/mm/vmstat.c~mm-vmstat-add-nrswpinout-counters +++ a/mm/vmstat.c @@ -1489,7 +1489,11 @@ const char * const vmstat_text[] = { #if THREAD_SIZE > 65536 [I(KSTACK_REST)] = "kstack_rest", #endif -#endif +#endif /* CONFIG_DEBUG_STACK_USAGE */ +#ifdef CONFIG_SWAP + [I(NRSWPIN)] = "nrswpin", + [I(NRSWPOUT)] = "nrswpout", +#endif /* CONFIG_SWAP */ #undef I #endif /* CONFIG_VM_EVENT_COUNTERS */ }; _ Patches currently in -mm which might be from hch@lst.de are mm-remove-wb_writeout_inc.patch shmem-provide-a-shmem_write_folio-wrapper.patch mm-swap-introduce-struct-swap_io_ctx.patch mm-swap-also-use-struct-swap_iocb-for-block-i-o.patch mm-swap-remove-count_swpout_vm_event.patch mm-swap-use-swap_ops-to-register-swap-devices-methods.patch mm-swap-remove-swp_fs_ops.patch mm-vmstat-add-nrswpinout-counters.patch