Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp87205rdb; Sun, 28 Jan 2024 15:20:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIzeq+QuZrPIMrdVN+fbG0OzBBbh/BvvPCyL0O8vbBoVJV+gPlBemJtfsphePGroK0cj8L X-Received: by 2002:ac8:5f4b:0:b0:429:e354:94cb with SMTP id y11-20020ac85f4b000000b00429e35494cbmr5334326qta.108.1706484013878; Sun, 28 Jan 2024 15:20:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706484013; cv=pass; d=google.com; s=arc-20160816; b=o8Q5zY+XToG3xWygsVihxi741iZhxicY4GDOS1vLAF8meyA8ZTKyiIDz4BpZw4mo6s vg87MJUR2AWhwY2M2I6gf307egW9s+w8MnLCBoiJbQN+M5glUicgfQ1tdqO4lb/D62F2 +7h9T80Lniq0uFmVifHecDBiMRuDW5J1lsKPjI9hBdwG1SkYZyoICy4dpyi0aXE+6evX fHdc3okV4zrBsxLaVCcjXP+Rq3WKxv7bC7Oa0+49Bl8BS1UPA54JyE8hFMW6PZPUBGr2 CRZDBD9tO44CLjRhMKcO+zl+EFGIkN9JfTlLN0Z/ZHZC3QdByNx22PGVvvLz1iZz9m0s ApRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=y7owlhmhi2gAoXU/UeiIuxV6mq5IG8XVGr21uGp5/40=; fh=tZaRcaBC2B9kz9LE0s3RcuBvld/Mh+wX/K4s7Z8MYq0=; b=ehJ1vntjpw72QLz0b9KjRTG7u4iwcpXLzxgRyUn1kurB/8q9Ntkdxxg9jtYEL7qJ+t 7WRMkyX5qxf2w3mu+vCUrduC+QPTsrPklNx5EBgip5hB8UpxPjzcNp8cC++SkFNSeKs8 /FqPR6dSIGVOYgYO7NEtV7SpwosnZhvexoesMD7yhOSklMM4GKZUcd9W2tvVW6xdMr+j psIc6dYCsbVzujWcIzVzK9hIK7pi5hMP2wngl+LXBT+c4nSjUrCISNXXsAQ0h9myyjb/ TXMhCHVpCOYtaTefxiiY92EYpURmr5JvKBFc7H01wrDllXsMRujs2GFTFKkPvG77eTT8 +lSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=X1k8QQ5p; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-41978-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41978-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c9-20020ac85a89000000b00429aeece0a5si6238174qtc.796.2024.01.28.15.20.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 15:20:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41978-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=X1k8QQ5p; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-41978-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41978-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7FDEE1C21FBD for ; Sun, 28 Jan 2024 22:03:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F6E33D568; Sun, 28 Jan 2024 22:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="X1k8QQ5p" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 D12B83CF44; Sun, 28 Jan 2024 22:02:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706479374; cv=none; b=jVPeuUFSoiu3UdkZkiJOcfWbtn5O3ylE6kiUaaLoaMw+gwApuyndZ2t0eD9r8/qmMdpKfTBbBge4Axy4FSB52/aouNZ9JwJikWWHkLfGwP/4nmbO+YfATdg9tAWQiTIUSlqg281/itUBPqZgsvMTSmyOchLEfecSQQL4npYpRJ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706479374; c=relaxed/simple; bh=5C4J0Ao+ZJ0LzdgubJzD/RjoPDpCc0XCOKB+k/bVZG0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SO6AdjCfZo2c1fj4hABa+XjkJ/MoSpk4Q8zFfInK3AaXJsq1yJEoRw3DP4RSR6BHSGgzaHXgjsbTYIC+1WXJ0ps9KJRi9R86Rbgh5Xk5NoOSwLT7pPQWdOrb614AyCNsO1itlKJkKQ2imnETyw61kHJTNPcWpj/2ggI4cSZy2TM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=X1k8QQ5p; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=y7owlhmhi2gAoXU/UeiIuxV6mq5IG8XVGr21uGp5/40=; b=X1k8QQ5pXWWbzG7O67QZFKgivf fC4g/yiD/pw9sbIud887+AHkhsj549Vtg9KNot/nBjV/HBtKG7yyvZKb4qzLdYyBXeX1FVqwTzk5+ OLVa4cfZYnxTiitLTIbnFTGWY5XD23C/3DYNAvZcKrbGDzeSypq9QHkgVFmnIaRz/WlR9AjqzBpwO JnwOEI14KUxGFsDAfQpYKajyh/iBrk6vy5fMzpPgSAMsohdV4ZgxYgd7RCPoxjUZf8Q9uetdVPZw0 Awbmxv1kdTiw9EuDqww/jOSeysk0rC+is0rNAaqXlEbxxaSqAczD9GbtHGIz9RORFmZWehVOoB2TE +MRe/u2w==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUDEn-00000004g71-0xeS; Sun, 28 Jan 2024 22:02:49 +0000 Date: Sun, 28 Jan 2024 22:02:49 +0000 From: Matthew Wilcox To: Ming Lei Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Snitzer , Don Dutile , Raghavendra K T Subject: Re: [RFC PATCH] mm/readahead: readahead aggressively if read drops in willneed range Message-ID: References: <20240128142522.1524741-1-ming.lei@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240128142522.1524741-1-ming.lei@redhat.com> On Sun, Jan 28, 2024 at 10:25:22PM +0800, Ming Lei wrote: > Since commit 6d2be915e589 ("mm/readahead.c: fix readahead failure for > memoryless NUMA nodes and limit readahead max_pages"), ADV_WILLNEED > only tries to readahead 512 pages, and the remained part in the advised > range fallback on normal readahead. Does the MAINTAINERS file mean nothing any more? > If bdi->ra_pages is set as small, readahead will perform not efficient > enough. Increasing read ahead may not be an option since workload may > have mixed random and sequential I/O. I thik there needs to be a lot more explanation than this about what's going on before we jump to "And therefore this patch is the right answer". > @@ -972,6 +974,7 @@ struct file_ra_state { > unsigned int ra_pages; > unsigned int mmap_miss; > loff_t prev_pos; > + struct maple_tree *need_mt; No. Embed the struct maple tree. Don't allocate it. What made you think this was the right approach?