Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2052222pxu; Tue, 24 Nov 2020 15:58:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSglI47+HW1C1BaNklByeYlX5EQ9XNwk8VX02G0gpro8y3GQ/NwDEPQSFyKlUhIMhmyjbO X-Received: by 2002:a05:6402:2206:: with SMTP id cq6mr970427edb.163.1606262310671; Tue, 24 Nov 2020 15:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606262310; cv=none; d=google.com; s=arc-20160816; b=AGmMoQoCVqp3CSIl2Mqx1o9RjFCmc8pAE2VnifbuVRezn0MO10ky34TRaVO7q5+CCC 8ZiVD9oTK8Gi2ha77mRzA3jLwRPT2fnYf6utPNhyJdwm47OK9LuZokXHggS1RIdQ7jdG Cl81MinQrbRZBcojbwuRylBGuPem+fMTws18a0jCskVDRW9chx3P6hF1A0LjxqP6KK2v Jw/egFZtzSqxaytsfrSVsF+qBBfVppyDf+2tYBmxpDtbGD+79/GWkTQ6mE2+mj7IAKmH LerCFp3Sge/7FeCz9GXr0jvSWnWea8faPKHDFLRs+QLjrATsK6WKc5zP+c90I+WMMlpz muCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yao9E9sn9zz+iZFIp2Psjk/MTQ2gFiyODukKu/NAT3g=; b=bUHEJ/WUa83XzNaZWpkmvBCqmx1Sgg5Pr+XvJYFxAxS3haqZIGb3JXoqHeTijLOhIW XRJXbVO/TFdvaljxRMN2cDNkreYpuYcT/nnrmNuF2pNUleJNn7EdSKApoXADB9GT/Ypo 3Cp9/VlmPi7S67xJloJKxi5aXVQVZhi8xKo8GVHdYnfr5eUZPc1GgPt0TXN3papVp2Y8 gGBO6Q+nlmn1TQ0fxZYHfJIreYafC1KZ6uz+tF9fSzRcORJ/AN+BggyNMjsi5Te5LVzf 71ULF1ufBVgtXxzcO1LHxvHOPaM65JLqZ+cJAfLwQfhLVVZ3UVh530rMja8Olaq+CUks AoRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=H3+EmdJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb13si267877ejb.539.2020.11.24.15.58.08; Tue, 24 Nov 2020 15:58:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=H3+EmdJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730812AbgKXUVa (ORCPT + 99 others); Tue, 24 Nov 2020 15:21:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730785AbgKXUVa (ORCPT ); Tue, 24 Nov 2020 15:21:30 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8827C0613D6; Tue, 24 Nov 2020 12:21:29 -0800 (PST) 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=yao9E9sn9zz+iZFIp2Psjk/MTQ2gFiyODukKu/NAT3g=; b=H3+EmdJarS1cfvvZ0ztNJkxZRb 4w5dA2wwkBoMn1YInAvdLxa8WRVKY09lpftouA8e1FWJkbI5Dkcy+jrFllWD4PY9+KVLSO6lfZmt+ RWHcB+yTx3JAbTdm8HdWkmAL0vj2UAQlJC3veZPlbdLtojIWnWKLAi4KIhjttMkVU86OzU9BSc4Px ROLC+bg2SVjEUWOyG8oPNiw0bONff2itEr9C0nHqL1fBsrlaw3vbftWq3tzbhEXGIP8bRodBCiJWt 6/nvoi9bBlTZUGPZ86KF3SVh5qFrVTJd5ZQKmh/wvuRtBv7Kck2bNK49SwHKPdojj+lwezm6gmwUX sBWTziNQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kheno-0001ew-4B; Tue, 24 Nov 2020 20:20:40 +0000 Date: Tue, 24 Nov 2020 20:20:40 +0000 From: Matthew Wilcox To: Ira Weiny Cc: Andrew Morton , Dave Hansen , Christoph Hellwig , Dan Williams , Al Viro , Eric Biggers , Thomas Gleixner , Luis Chamberlain , Patrik Jakobsson , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Howells , Chris Mason , Josef Bacik , David Sterba , Steve French , Jaegeuk Kim , Chao Yu , Nicolas Pitre , "Martin K. Petersen" , Brian King , Greg Kroah-Hartman , Alexei Starovoitov , Daniel Borkmann , =?iso-8859-1?B?Suly9G1l?= Glisse , Kirti Wankhede , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 01/17] mm/highmem: Lift memcpy_[to|from]_page and memset_page to core Message-ID: <20201124202040.GF4327@casper.infradead.org> References: <20201124060755.1405602-1-ira.weiny@intel.com> <20201124060755.1405602-2-ira.weiny@intel.com> <20201124141941.GB4327@casper.infradead.org> <20201124192113.GL1161629@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201124192113.GL1161629@iweiny-DESK2.sc.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 24, 2020 at 11:21:13AM -0800, Ira Weiny wrote: > On Tue, Nov 24, 2020 at 02:19:41PM +0000, Matthew Wilcox wrote: > > On Mon, Nov 23, 2020 at 10:07:39PM -0800, ira.weiny@intel.com wrote: > > > +static inline void memzero_page(struct page *page, size_t offset, size_t len) > > > +{ > > > + memset_page(page, 0, offset, len); > > > +} > > > > This is a less-capable zero_user_segments(). > > Actually it is a duplicate of zero_user()... Sorry I did not notice those... > :-( > > Why are they called '_user_'? git knows ... commit 01f2705daf5a36208e69d7cf95db9c330f843af6 Author: Nate Diller Date: Wed May 9 02:35:07 2007 -0700 fs: convert core functions to zero_user_page It's very common for file systems to need to zero part or all of a page, the simplist way is just to use kmap_atomic() and memset(). There's actually a library function in include/linux/highmem.h that does exactly that, but it's confusingly named memclear_highpage_flush(), which is descriptive of *how* it does the work rather than what the *purpose* is. So this patchset renames the function to zero_user_page(), and calls it from the various places that currently open code it. This first patch introduces the new function call, and converts all the core kernel callsites, both the open-coded ones and the old memclear_highpage_flush() ones. Following this patch is a series of conversions for each file system individually, per AKPM, and finally a patch deprecating the old call. The diffstat below shows the entire patchset.