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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAB42C352A1 for ; Wed, 7 Dec 2022 13:51:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BA548E0003; Wed, 7 Dec 2022 08:51:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36ACC8E0001; Wed, 7 Dec 2022 08:51:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 232278E0003; Wed, 7 Dec 2022 08:51:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 100628E0001 for ; Wed, 7 Dec 2022 08:51:06 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CD76C80B32 for ; Wed, 7 Dec 2022 13:51:05 +0000 (UTC) X-FDA: 80215646490.17.20EB6D6 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf29.hostedemail.com (Postfix) with ESMTP id 314C7120008 for ; Wed, 7 Dec 2022 13:51:04 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=fhgAF5VZ; dkim=pass header.d=linutronix.de header.s=2020e header.b=VwIcAmFo; spf=pass (imf29.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670421065; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mx4FrQXn0z6frpjJL58zvvJiiJEsdejNIy8r20RlzLQ=; b=Ika5LsEv1TrciushYuUjmAgjyLGIzC47pnjJkDvddZqTAuYpoHqVurO4zRbJpl46LIjmhD 1CShUHyvMt2jj1F6WpsfUqQ0hurNl9pP8Gm4vsm+q/Dm3jiUozwnFGh6ilBHQkNXseAro6 iaNR1N7jnN8zjISKJozRc0PxYSg65RE= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=fhgAF5VZ; dkim=pass header.d=linutronix.de header.s=2020e header.b=VwIcAmFo; spf=pass (imf29.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670421065; a=rsa-sha256; cv=none; b=5nNMKRklh9f0IsNDRZf9w10KRhrj96cgkDwpTgBZ/SZLuFLiKumfH40dZO5IRXoaMOvSo1 XrW9lMrySAjIelbG7H0rt+mZ7jhGxMVfcvWYX7QPQqkEc6oqef8+sXBBHaOVDqeGHCaoAi HScPR4Zqp0N8y+B1X0g2gxx6RMxtMwA= Date: Wed, 7 Dec 2022 14:51:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1670421062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mx4FrQXn0z6frpjJL58zvvJiiJEsdejNIy8r20RlzLQ=; b=fhgAF5VZ5RbrnyyxU0aLj2zyfMX8TDZrLvDtt1Pfl/zXnfX+CyjTaeb48aF94viXyU3fmS BCd5+JK1eB37TzHrTbikq4iMcZFsGYFBc8NbT2FhJhS8L34ZQoIQUFOzx0Ml8RauAyIC+5 AIpiyAjb1sNI8hAHR+9IUG0BUYeBmlDxaRcYWpR1S2LPr0lgID6/xsmTI9rhpJ2qGPRY1I rSS9Yx6vLEafwaxND8dtZSYDua0maa+csYfmaENgRv4GLNNjLf0py0bIoAfiiDR2rPDuFx PrM3Y2+rU0M30IxYm2GEjJvuinB8E9a/zZpHwBipK5bhkO9Jbfmj1DGzV7m3Qw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1670421062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mx4FrQXn0z6frpjJL58zvvJiiJEsdejNIy8r20RlzLQ=; b=VwIcAmFoune3EAEcU8UR0VM73wCNNZtNGlfDDIxvunb7L/LBZoFywPpsPDgWsYlJp0vTHC 9suybCGfH4tlsbDw== From: Sebastian Andrzej Siewior To: "Fabio M. De Francesco" Cc: Jonathan Corbet , Andrew Morton , Ira Weiny , Mike Rapoport , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mike Rapoport , Peter Zijlstra , Thomas Gleixner Subject: Re: [PATCH] mm/highmem: Add notes about conversions from kmap{,_atomic}() Message-ID: References: <20221206070029.7342-1-fmdefrancesco@gmail.com> <2093077.OBFZWjSADL@suse> <2130641.irdbgypaU6@suse> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <2130641.irdbgypaU6@suse> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 314C7120008 X-Rspam-User: X-Stat-Signature: gmoqds3564uq6b5y7addw95no1nesfcn X-Spamd-Result: default: False [-2.57 / 9.00]; BAYES_HAM(-2.57)[89.95%]; SUBJECT_HAS_UNDERSCORES(1.00)[]; DMARC_POLICY_ALLOW(-0.50)[linutronix.de,none]; R_DKIM_ALLOW(-0.20)[linutronix.de:s=2020,linutronix.de:s=2020e]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_SEVEN(0.00)[11]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[linutronix.de:+]; TO_DN_SOME(0.00)[]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; ARC_NA(0.00)[] X-HE-Tag: 1670421064-422393 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2022-12-07 14:01:50 [+0100], Fabio M. De Francesco wrote: > > > If so, I understand and I again agree with you. If not, I'm missing > > > something; so please let me understand properly. > > >=20 > > > Aside from the above, I'm not sure whether you deleted the last phrase > > > before > > > your suggestion. What about making it to become "For the above-mentio= ned > > > cases, conversions should also explicitly disable page-faults and/or > > > preemption"? > >=20 > > They need to disable preemption or page-faults or both if it is needed > > (not unconditionally) and where it is needed. This means not > > unconditionally over the whole kmap-ed section. >=20 > I never meant to suggest to _unconditionally_ disable page-faults=20 > and/or preemption. I was only trying to say that developers must carefull= y=20 > check whether or not the whole kmap-ed section depended on those side eff= ects. I know. That are the two condition that should be checked/ kept in mind while replacing the code. Maybe I read it wrongly=E2=80=A6 > If so, they must _explicitly_ disable preemption or page-faults or both= =20 > together with the use of kmap_local_page(). Right. The requirement for it should be probably documented in case it is not obvious. For PREEMPT_RT it will become a problem if the preempt disabled section additionally acquired a spinlock_t or allocated memory.=20 So ideally it won't be used ;) > Instead, if the section doesn= 't=20 > depend on preemption and/or page-faults disabling, they must only replace= =20 > kmap_atomic() with kmap_local_page(). Correct and I assumed that you know all this.=20 > I had probably used a bad wording when trying to say the same things that= you=20 > wrote much more clearly. Write it as you wish I just made a recommendation. If the wording is crystal clear then there is less room for interpretations. > Thanks, >=20 > Fabio Sebastian