Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp687752rdb; Fri, 2 Feb 2024 00:15:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLaeRIsxJg+cRo8UmbQwAyh0/keReVqVjcg5k2GT82nNKAtu5SheMCmF6t+f8jQkORZ9Z1 X-Received: by 2002:a25:2e4a:0:b0:dc6:9c4f:2c23 with SMTP id b10-20020a252e4a000000b00dc69c4f2c23mr7898912ybn.32.1706861748466; Fri, 02 Feb 2024 00:15:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706861748; cv=pass; d=google.com; s=arc-20160816; b=LNeY6h/0mU/jxTxipvlkmti68fjF0k84lNaoP9VievnqG4WDZY60k7HlMAZfATwRo7 K0ReRdLodhpoJLyBvjUw7I6tCC87UAlhgFu3HgL9nf8VVpgtTlUD6ANHaRvINbWprXeY xeq8CccOyHSZYDbGgr2gK5IWYEx8FaiYiB4Y1/SxQZ3CEiv5uCst1Y73ik0FzLnecn6b jpOXS6y6rNIzlzl6qKUM+28px3bRir6CAmxUrxAUm6IecJeGcUf03uSL+GdvTpS9jg0a UoeshJ1Yuq5okcKoVOUE3cv5YKpqRS1WBIIhd7ZYS2kU61RnuFitPKl0B4sOrOYSksGk YmiA== 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=p3ixc7xOxGnAntqDXaoDdSsv0shKrOpuXUN8Nh+tsrM=; fh=dXrTocO9yW1/ex9TQrUZ5GWH/l9WFyKTvM43xtSprfs=; b=Svv6PVSaocmZGwPRS9mYPrU9DQilI0HLTKVT8YMFHKx1PG1WxBC9lesNQVi0KBf5zz e5GZLBcpwozhc5O3I7dc6h/YrRCgEb5QMn1cKbIgU+/66ubBdn3BH/C0Uw/5vv6uFMhf qE+g6s31ROq7/8vi2NKEpKP8kAC67KGMSdezKIU4IMCFH6DorA/jh/uBFaHEj/VBtMSE 3xMSsJVFMJB5enMWX4KwRFyl3ovixYPdiu+K7KMF5SIOgXqxEYlQ3IJfz84hBnXmEPPh Y/YKONI0LqisD1LW4ioCXM/FjRAzf/1yk8C4NIQkGrQcu/v5yCkws6Z0uSwE5byQI61v xkMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lalX4tc9; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-49184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49184-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVr7HCaRfTxdBbeYFyhRrFjrIz9UU8zPbmGlbklF808y0vG0t2hWHHCsyIlFnivPNLvFkgIkvB3FkjTN8Rx5YWMGZjKIzrO9pP0pRNj3g== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dc12-20020a056214174c00b0067f68fb505fsi1410542qvb.577.2024.02.02.00.15.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 00:15:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lalX4tc9; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-49184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49184-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 6562B1C25ADB for ; Fri, 2 Feb 2024 04:15:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9C59EAEF; Fri, 2 Feb 2024 04:15:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="lalX4tc9" 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 3D616F51D; Fri, 2 Feb 2024 04:15:43 +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=1706847346; cv=none; b=Yu9n5Mx6HAhYujm7L8cf5I82ffxUCyEE5BejhlXvlfMPnzbYx2tTJlRzHyr1xV6BSz83iQz7AC4yXWfj8/swwTfXC2SPh/Pl4mAGHXlSqO+j0r1MdVTe3BtgK7tUizel01n0Nm1LhD8Yc0Jr9XtYk9rrMZqZBQoHhNjyd/z35xc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706847346; c=relaxed/simple; bh=9MVNGYON3I3TYe4RK9+epNKhwSjMObmQ1NUsggK6G0I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N6mzs2St2tlq/LW9cJnFZ6ddn4IowC8R+M8mKYEtZdip8OOWZc/mHf2Ys2i2SquS23MtANosMFHCVbUbAKoubKEvLWv5zXZQ1gZ39AosvYznp2hNDRtoynzQNBu9W84wC32JNu+CRC7ZecFDD8xLo5dKS+znll8PUCG/lIsP35A= 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=lalX4tc9; 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=p3ixc7xOxGnAntqDXaoDdSsv0shKrOpuXUN8Nh+tsrM=; b=lalX4tc9Vfkolj7JczpTxRNVwo pHdD2uo9pRSZmmrBqYvCRuQ+OEV+AFi40Ssv8tjbePX/mCMI4DdTUWenA1YKVXUkFvZFITgSknIs2 Xylq03WiiyzsFc5lc1GMDRSvx5PXh89KBRqDEeOdP12R0RzDmNAlc6LMgR2xcrxuzF+cveQ5Dd5F+ fjthmkCRvEAdugiZsj0XdbkuiiNGGAGEAQ9HjxQ0O1TCxHuNSVtL1iEA6F5Vuy8hdItMq8ByTIGt+ Xu2xxpqBuOfZ26W9jtzpI7eWDiHinmyRD5ct4azlN7cIHOPKigOuWjwUNDkj6CWmGufBEXw6XgizO E91ERloQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVkxn-000000004Er-3S5p; Fri, 02 Feb 2024 04:15:39 +0000 Date: Fri, 2 Feb 2024 04:15:39 +0000 From: Matthew Wilcox To: Ming Lei Cc: Andrew Morton , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, David Hildenbrand , Alexander Viro , Christian Brauner , Don Dutile , Rafael Aquini , Dave Chinner , Mike Snitzer Subject: Re: [PATCH] mm/madvise: set ra_pages as device max request size during ADV_POPULATE_READ Message-ID: References: <20240202022029.1903629-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: <20240202022029.1903629-1-ming.lei@redhat.com> On Fri, Feb 02, 2024 at 10:20:29AM +0800, Ming Lei wrote: > +static struct file *madvise_override_ra_win(struct file *f, > + unsigned long start, unsigned long end, > + unsigned int *old_ra_pages) > +{ > + unsigned int io_pages; > + > + if (!f || !f->f_mapping || !f->f_mapping->host) > + return NULL; How can ->f_mapping be NULL? How can f_mapping->host be NULL?