Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2142923rwb; Thu, 19 Jan 2023 21:55:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXvjrdgIYTTNDoDcKL73lfWAAYz00CX7ksyc2253/9E5PIpyOazKMc+JIAfqpzxZ8lcXVpde X-Received: by 2002:a05:6a20:e609:b0:b8:9c66:cd66 with SMTP id my9-20020a056a20e60900b000b89c66cd66mr14324184pzb.18.1674194137783; Thu, 19 Jan 2023 21:55:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674194137; cv=none; d=google.com; s=arc-20160816; b=V8cCBRZbn+glUBC8qZpjh8yDftItoGHM0iLVZJE20LaEn6DrBYjvf7JWdvqUlfN2xs bAzVD6uUDh2RAN/MlwCuFxvntJP30Uc4Sn4/zpNGyJfULhS0zJATvy0I6d8mls15zd7B 4PSIMF4e5R/TCpdE/a033x1HrI8yHibDskDjDzb7+v4bPlFL5O/idB0WVDFh3TIvpCGO OOoFNDex+NcCMQp98nf4tXef25ZhyBigZgruVqdopJNgGOBjmgjCy/sdzFh53pzMAJni bfH94WGNxqfUJoQD3BrvxL88xr0ClwdJ9mM7g5yvjAcqP1R5Qe2Hfol5VZ4IcZ0rypIf 3+hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=g/TYi0LB0LucaQ9Jt/Zfn/ruUAjCWhwXHm/cIx9iKKI=; b=QDEcmBsYOZP33l7MTD602VMoxuN59/9M8tfaFKhe7f3L5HrlPy99E1+bx3+KJbjdNu 9M+utBCD8qlpILsZMgmGVnyhdLCktgEAFATqh0lewstWEQlsmCP0xmeLd0MW7Z7aFaYf cRvR3P/PSxaeODWMmCpApjP9AKMndFRIGG7mdyBtuCafVnlTpKrs+8YaVSEghXu3cJKC 5kgBgETeEiqRcHhUVatfeVLp/5h8fMh9d6Tr495vRmco0ZvJ5MgrfzU04yaL+ZWzWSwy 6aKei15zu/4bVWq1NQy1LTIwkh9HOh87dycHI6MWItq1Ux9bmM64KIvrDtd2n6WxfNeB Mpzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="MA/iuuf4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a63214a000000b0047873dedf41si41597578pgm.415.2023.01.19.21.55.32; Thu, 19 Jan 2023 21:55:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="MA/iuuf4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231251AbjATFTD (ORCPT + 47 others); Fri, 20 Jan 2023 00:19:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231221AbjATFSg (ORCPT ); Fri, 20 Jan 2023 00:18:36 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35AF185360; Thu, 19 Jan 2023 21:07:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=g/TYi0LB0LucaQ9Jt/Zfn/ruUAjCWhwXHm/cIx9iKKI=; b=MA/iuuf4iMjeYtuAHKwoM2MYx9 7PcVfgg/wTBfnv68t3jrBAZfi2WWE3wARYXliZxVXkh+4+LEf0AhmW+E9BsP2hNLVN+gQHmKjATGr O2ZlcE2H9MV6PYHu5oWKo0TGQdfL83CfZtpki0QjrYT7W8jpq50t5DiFvZZWU38C/pKuPjVmwtgX9 D1vzxHMw70EYzvNynDowQsCR3OkEy4BH5fpvEGA5iWSQ0hJbjMXC/QG6eq6BMoQ3eEwFOspbfYt3V cPELBST0kyhHzzpjrPHY9LCJpNMEOAiJJh5G6KgvExA2I5tEVIz3FIj9Dt3v5sWFzwdbCM/ilkxY3 cATIMMuQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1pIjcy-002vbe-0X; Fri, 20 Jan 2023 05:07:48 +0000 Date: Fri, 20 Jan 2023 05:07:48 +0000 From: Al Viro To: Matthew Wilcox Cc: "Fabio M. De Francesco" , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Ira Weiny Subject: Re: [PATCH v3 4/4] fs/sysv: Replace kmap() with kmap_local_page() Message-ID: References: <20230119153232.29750-1-fmdefrancesco@gmail.com> <20230119153232.29750-5-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 20, 2023 at 04:54:51AM +0000, Matthew Wilcox wrote: > > Sure, but... there's also this: > > > > static inline void __kunmap_local(const void *addr) > > { > > #ifdef ARCH_HAS_FLUSH_ON_KUNMAP > > kunmap_flush_on_unmap(addr); > > #endif > > } > > > > Are you sure that the guts of that thing will be happy with address that is not > > page-aligned? I've looked there at some point, got scared of parisc (IIRC) > > MMU details and decided not to rely upon that... > > Ugh, PA-RISC (the only implementor) definitely will flush the wrong > addresses. I think we should do this, as having bugs that only manifest > on one not-well-tested architecture seems Bad. > > static inline void __kunmap_local(const void *addr) > { > #ifdef ARCH_HAS_FLUSH_ON_KUNMAP > - kunmap_flush_on_unmap(addr); > + kunmap_flush_on_unmap(PAGE_ALIGN_DOWN(addr)); > #endif > } PTR_ALIGN_DOWN(addr, PAGE_SIZE), perhaps?