Re: Question about dm-cache promotion decision in dm-cache-policy-smq.c (commit b29d498)

2025-07-15 Thread Ming Hung Tsai
On Sat, Jul 12, 2025 at 5:14 AM Robert Pang wrote: > > Here's a rewritten version of your email, aiming for clarity, > conciseness, and a professional tone: > > Subject: Question about dm-cache promotion decision in dm-cache-policy-smq.c > Hi, > > I'm currently investigating how dm-cache makes pro

Re: [PATCH v6 0/6] block/md/dm: set chunk_sectors from stacked dev stripe size

2025-07-15 Thread Hannes Reinecke
On 7/14/25 08:13, Christoph Hellwig wrote: On Mon, Jul 14, 2025 at 03:00:57PM +0900, Damien Le Moal wrote: Agreed, it would be nice to clean that up. BUT, the chunk_sectors sysfs attribute file is reporting the zone size today. Changing that may break applications. So I am not sure if we can act

[PATCH v4 08/11] dm-pcache: add cache_key

2025-07-15 Thread Dongsheng Yang
Add *cache_key.c* which becomes the heart of dm-pcache’s in-memory index and on-media key-set (“kset”) format. * Key objects (`struct pcache_cache_key`) - Slab-backed allocator & ref-count helpers - `cache_key_encode()/decode()` translate between in-memory keys and their on-disk representa

[PATCH v4 06/11] dm-pcache: add cache_writeback

2025-07-15 Thread Dongsheng Yang
Introduce cache_writeback.c, which implements the asynchronous write-back path for pcache. The new file is responsible for detecting dirty data, organising it into an in-memory tree, issuing bios to the backing block device, and advancing the cache’s *dirty tail* pointer once data has been safely

[PATCH v4 10/11] dm-pcache: add cache core

2025-07-15 Thread Dongsheng Yang
Add cache.c and cache.h that introduce the top-level “struct pcache_cache”. This object glues together the backing block device, the persistent-memory cache device, segment array, RB-tree indexes, and the background workers for write-back and garbage collection. * Persistent metadata - pcache_ca

[PATCH v4 01/11] dm-pcache: add pcache_internal.h

2025-07-15 Thread Dongsheng Yang
Consolidate common PCACHE helpers into a new header so that subsequent patches can include them without repeating boiler-plate. - Logging macros with unified prefix and location info. - Common constants (KB/MB helpers, metadata replica count, CRC seed). - On-disk metadata header definition and CRC

[PATCH v4 05/11] dm-pcache: add cache_segment

2025-07-15 Thread Dongsheng Yang
Introduce *cache_segment.c*, the in-memory/on-disk glue that lets a `struct pcache_cache` manage its array of data segments. * Metadata handling - Loads the most-recent replica of both the segment-info block (`struct pcache_segment_info`) and per-segment generation counter (`struct pcach

[PATCH v4 07/11] dm-pcache: add cache_gc

2025-07-15 Thread Dongsheng Yang
Introduce cache_gc.c, a self-contained engine that reclaims cache segments whose data have already been flushed to the backing device. Running in the cache workqueue, the GC keeps segment usage below the user-configurable *cache_gc_percent* threshold. * need_gc() – decides when to trigger GC by ch

[PATCH v4 04/11] dm-pcache: add segment layer

2025-07-15 Thread Dongsheng Yang
Introduce segment.{c,h}, an internal abstraction that encapsulates everything related to a single pcache *segment* (the fixed-size allocation unit stored on the cache-device). * On-disk metadata (`struct pcache_segment_info`) - Embedded `struct pcache_meta_header` for CRC/sequence handling. -

[PATCH v4 00/11] dm-pcache – persistent-memory cache for block devices

2025-07-15 Thread Dongsheng Yang
Hi Mikulas, This is V4 for dm-pcache, please help to review. Code: https://github.com/DataTravelGuide/linux tags/pcache_v4 Changelogs V4 from V3: - go back to use mempool for allocation of cache_key and backing_dev_req. - introduce backing_bvec_cache and ba

[PATCH v4 02/11] dm-pcache: add backing device management

2025-07-15 Thread Dongsheng Yang
This patch introduces *backing_dev.{c,h}*, a self-contained layer that handles all interaction with the *backing block device* where cache write-back and cache-miss reads are serviced. Isolating this logic keeps the core dm-pcache code free of low-level bio plumbing. * Device setup / teardown -

[PATCH v4 11/11] dm-pcache: initial dm-pcache target

2025-07-15 Thread Dongsheng Yang
Add the top-level integration pieces that make the new persistent-memory cache target usable from device-mapper: * Documentation - `Documentation/admin-guide/device-mapper/dm-pcache.rst` explains the design, table syntax, status fields and runtime messages. * Core target implementation -

[PATCH v4 09/11] dm-pcache: add cache_req

2025-07-15 Thread Dongsheng Yang
Introduce cache_req.c, the high-level engine that drives I/O requests through dm-pcache. It decides whether data is served from the cache or fetched from the backing device, allocates new cache space on writes, and flushes dirty ksets when required. * Read path - Traverses the striped RB-trees t

[PATCH v4 03/11] dm-pcache: add cache device

2025-07-15 Thread Dongsheng Yang
Add cache_dev.{c,h} to manage the persistent-memory device that stores all pcache metadata and data segments. Splitting this logic out keeps the main dm-pcache code focused on policy while cache_dev handles the low-level interaction with the DAX block device. * DAX mapping - Opens the underlyin