From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 759FC39184A for ; Sat, 25 Jul 2026 18:26:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785003993; cv=none; b=YZsGSswxn7BJqQAv+glEwjtzrXZXOqYzWlKhV8Ob11RHGclWEPOK5Hy9yigE40gx/UwlTP99yWqiuKjzz98jrSlxpyu9uwtkFtAaqufLg0wDwGjnKQT8cWbLTcIhXdRluO26qDFZCpbHmGzHvSW4Wu3JL5jsSQn+XdUNk3wzjm8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785003993; c=relaxed/simple; bh=Q7m6uSH3909irst+1l9pCSJBqxny3rg4Krml/d0+ptc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=H987/tbuKyrNGB8bbq+Ojct6vs3YtM1NLVqSzksMu8asihhHXPDXmDaEFurYcMLJkfJSlzyynKzDyOrvd0R7DSuNL4VCnvToipRMrKZ3AECMtDGWTgirZ2IJVso9Z3lIGkYgk9QPPhxflRitSE1YL/iR6DiQwbW8eM7cTKU8u1c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mypOdOxF; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mypOdOxF" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-493f6de72faso11814285e9.0 for ; Sat, 25 Jul 2026 11:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785003991; x=1785608791; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=B3mFtNIDwmIHE/JWuXcFpV7vETg69hB4Zppykix3hko=; b=mypOdOxFgIAWWnkZSmcy33tNBsug/qVxC0XtGFPyslF/9DuNeNoi8xICNldojxF2b3 NObI9K41sUAIvx42q+UbQ8e2mWBCP8MjdyeRvD2tFhOG4iU/AijeJaJ+eGWJN19r/A3E e1JDXREyCQFEM6rwAAOlwp0llqDwcNu7axpDZLVlPQhTqVcUykK5mESXIc3lV6as4Wad 6NWl2z2rPRPlTmlinUGkCoU5+nEAXrYp/MjNlNtWljtyYsbQwKPbSybAN79/PkgKi8Ei TDxt2Wxdb3VfutSkx+0VF8liCs6wrpT77myBOfomV8RU5X2gw6zQ9l7DvH6Hix50UYmC 0WiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785003991; x=1785608791; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=B3mFtNIDwmIHE/JWuXcFpV7vETg69hB4Zppykix3hko=; b=Tw4mapwpb82fMbmAXWPnR0adp4ZudbJXNS2zzF33eLdK5+oWkyyLNOylgG9N5Dmyra WIO6ixZtyIeaLYVAbminHRuF+pxR7h3x+BkKkZAeVMvUJ/cgNPOoCYcIppgAp4Hu3HeW uf8IwEtqs6eB4xbaqvS2El1dWNlS0BXP15m13aAxGPM+xP+aA6SWuXRRrP7er5EvaMtD Vwg4lWsq6/OuOPnrjzjtiA7DHFMKzL8MbxrApiho6Sl1KE2eUb02XrB5fkJ/rcE/Hbxa ac2RvCdFlCyhUq6TPttUftr1bt0wzH49B2AavbyGH4rfjx09TytIlTVtZgN0FZAIFlkw Lx9A== X-Gm-Message-State: AOJu0YwzFMS7G2gc+aszjlONL/97+aaxbbxN3R892UxEixO+dGgUS/NW ZlAw4LfrQCN+Btnngp24dGQC8RqD23x77ATflyICfFKWId+XkIy0LQqr7apT6lcz X-Gm-Gg: AR+sD123Myk2iUERDyQCi6UP7I71iTVq1pLgAVyZIt39E+oBqGzpHWtQ+B0fvIHtDh0 02x5NEZOWh90Ta9eNjhbrVcR26VTToTRWBu3gH6NAeKWMwSbHGJmAAxNRV+2wwRkRIwKyfTdQHm yamzTR1xnGpsxUO+tXOyB0Rt8wc9Q02cettHuduNmKiiUjJUhhibk4gvBAGIkTTsDJ4d5R4GOeR acdGjTAFcBmBLp7IKADf8L1vCVRN2hvF37vSmb33e9FsjkgCuvY68+j8avukZRt/G07/GkbT/K8 9Ol8msPoZ27Nrb2e2TmKwbtAZEKajIo/VhMG+tRkku55AN3XzGkpSLi7MQ/Jb+SlInB8U2sk4Yf 8WLv2cnH4h6L99w+/pPVTj/6iIpfvW4G2ndzFXfu20wi5UOxFyjcG406zWBmAjiXrh3gK7sDDSx oRI0ujcZk= X-Received: by 2002:a05:600c:4ed2:b0:495:6934:4146 with SMTP id 5b1f17b1804b1-496b5c71914mr33588635e9.11.1785003990446; Sat, 25 Jul 2026 11:26:30 -0700 (PDT) Received: from localhost ([178.241.98.184]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-496b485ff2csm111107805e9.6.2026.07.25.11.26.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jul 2026 11:26:30 -0700 (PDT) From: Ayhan Aydin To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: nsd.project.dev@gmail.com Subject: [RFC PATCH 0/3] Neural Storage Driver - learning page cache prefetcher Date: Sat, 25 Jul 2026 21:26:25 +0300 Message-ID: <20260725182628.221603-1-nsd.project.dev@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hello, This RFC introduces NSD (Neural Storage Driver), a learning prefetcher for the Linux kernel page cache. NSD monitors I/O patterns via a hook in filemap_read() and prefetches pages using page_cache_sync_readahead(). Background ========== The kernel existing readahead uses a fixed-window approach that works well for purely sequential access. NSD builds on this by learning access patterns at 4KB region granularity using a synaptic Markov chain: - Records transitions between file regions - Detects sequential strides of arbitrary length - Issues page_cache_sync_readahead() for predicted pages - Achieves 98% real hit rate on prefetched pages (SSD) Performance (x86_64, SATA SSD, kernel 7.0.0) ============================================= SQLite FTS (4GB table): -18.8% query time Sequential 64K buffered: +22.6% throughput Random 4K buffered: +1.1% (noise) Read latency: 130us (no regression) Key Question ============ Is this approach suitable for the Linux readahead infrastructure? I would like to hear your opinions on the architecture. The module currently hooks filemap_read() and issues prefetch via page_cache_sync_readahead(). Would a deeper integration with the existing ra_state / file_ra_struct be preferred? Should we extend file_ra_struct to accommodate pattern history, or keep the predictor as a separate subsystem? Patch Summary ============= 1/3: mm/filemap: Add NSD prefetch hook point (+5 lines) 2/3: nsd: Core prediction engine (fs/nsd/, ~480 lines) 3/3: Documentation: Add NSD documentation and MAINTAINERS entry Signed-off-by: Ayhan Aydin ---