From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F1DFC12002 for ; Mon, 19 Jul 2021 15:54:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A887E611F2 for ; Mon, 19 Jul 2021 15:54:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A887E611F2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D4C98D00F4; Mon, 19 Jul 2021 11:54:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 284CC8D00EC; Mon, 19 Jul 2021 11:54:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1260D8D00F4; Mon, 19 Jul 2021 11:54:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id DF7658D00EC for ; Mon, 19 Jul 2021 11:54:14 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7A0221810F5E6 for ; Mon, 19 Jul 2021 15:54:13 +0000 (UTC) X-FDA: 78379783986.15.7CFF1AA Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) by imf21.hostedemail.com (Postfix) with ESMTP id DC1FCD0098AF for ; Mon, 19 Jul 2021 15:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DEv5AMPYTsRvufOgvEX+iyR62xQvFefugMO+OsVkHzc=; b=DdKXacyQxn7Hz8fN7PJPr6m9x d4hT/T0CJ5vKsm+NrCyfhhcEa16qr7fh5ZmNRudBMiNsh2jWmw+8ed7lCBIMi/jmkxYayCvxuuGFK 4hGzvSFep0kUFA1ZNBEEQeCQdSfzUhQ6zgFkq82drCAMx1t9UybqRKDrNW6URJC1JvCwW0DMXWT0J m8V5Vgh2JPge/tTVm8IONzCUUTFB5PbqFmG7VItuZoc2Wg8A7OONJFrHCYD+gnCyml/DiKV1jbrlh EcOJfYmvL8Ub22suPEmn9SZalhR+cT/W6dvmJJoHr8kHoEp/k9Sarl2dHD3wp1WISKxfd40O6Ylfs YGaL+yUww==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:46332) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5VPo-00054L-KD; Mon, 19 Jul 2021 16:42:44 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1m5VPi-00066F-Ex; Mon, 19 Jul 2021 16:42:38 +0100 Date: Mon, 19 Jul 2021 16:42:38 +0100 From: "Russell King (Oracle)" To: Herbert Xu Cc: hch@lst.de, torvalds@linux-foundation.org, akpm@linux-foundation.org, James.Bottomley@hansenpartnership.com, guoren@kernel.org, tsbogend@alpha.franken.de, nickhu@andestech.com, green.hu@gmail.com, deanbo422@gmail.com, deller@gmx.de, ysato@users.sourceforge.jp, dalias@libc.org, geoff@infradead.org, paul@crapouillou.net, ulf.hansson@linaro.org, alexs@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org Subject: Re: flush_kernel_dcache_page fixes and removal Message-ID: <20210719154238.GS22278@shell.armlinux.org.uk> References: <20210713084648.GF22278@shell.armlinux.org.uk> <20210719053851.GA16780@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210719053851.GA16780@gondor.apana.org.au> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DC1FCD0098AF X-Stat-Signature: xjsx9r1yr14yju5t58u88hcwk97rtazx Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=armlinux.org.uk header.s=pandora-2019 header.b=DdKXacyQ; dmarc=pass (policy=none) header.from=armlinux.org.uk; spf=none (imf21.hostedemail.com: domain of linux@armlinux.org.uk has no SPF policy when checking 78.32.30.218) smtp.mailfrom=linux@armlinux.org.uk X-HE-Tag: 1626710052-905286 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000585, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jul 19, 2021 at 01:38:51PM +0800, Herbert Xu wrote: > Russell King Oracle wrote: > > > > I think you need to be careful - I seem to have a recollection that the > > reason we ended up with flush_kernel_dcache_page() was the need to avoid > > the taking of the mmap lock for 32-bit ARM VIVT based CPUs in > > flush_dcache_page(). 32-bit ARM flush_dcache_page() can block. > > > > If you're sure that all these changes you're making do not end up > > calling flush_dcache_page() from a path where we are atomic, then fine. > > The Crypto API has been calling flush_dcache_page from softirq > context since before the advent of git (see crypto/scatterwalk.c > from the initial import). So if 32-bit ARM blocks on it then this > has been broken for almost 20 years. I think what's confusing me is the naming of flush_dcache_mmap_lock(). The mmap lock is a read-write semaphore (see linux/mmap-lock.h), and is even called "mmap_lock" in mm_struct, but this has nothing to do with flush_dcache_mmap_lock(). So no, flush_dcache_mmap_lock() doesn't block as I first thought, and therefore flush_dcache_page() doesn't block either. Sorry for the noise. However, I now seem to remember some discussion in the past when I was trying to get people to use flush_dcache_page() to solve the coherency problems when block drivers were doing PIO to page cache pages. I seem to remember there being objections to it, which is one of the reasons we ended up with a lighter weight flush_kernel_dcache_page(). But shrug, dim and distant memories. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!