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 3C1E3C63703 for ; Wed, 7 Dec 2022 23:03:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C07AA8E0003; Wed, 7 Dec 2022 18:03:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BB8B38E0001; Wed, 7 Dec 2022 18:03:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A829F8E0003; Wed, 7 Dec 2022 18:03:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 978F48E0001 for ; Wed, 7 Dec 2022 18:03:35 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6A86580EBF for ; Wed, 7 Dec 2022 23:03:35 +0000 (UTC) X-FDA: 80217038790.25.4A97B00 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by imf14.hostedemail.com (Postfix) with ESMTP id B93B5100018 for ; Wed, 7 Dec 2022 23:03:33 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Dj7+8fB4; spf=pass (imf14.hostedemail.com: domain of fmdefrancesco@gmail.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=fmdefrancesco@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670454213; 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=OlRZXX5fi6uW5Xh2LMxBmgQ7B0VSc2snpywNu1tW4NI=; b=wIrhPVhhJRxqtlGFcUmEao0860WI2Dmoyzzp8C9YHgr+dYzofwKib1T6J1Na0qrEROFMMM Uxrv024hU05YylqD864tnxOwYJfoCFqXQlM2cJrc7Wq8f9I1e4Hcvw5m7virYcAjSm2fGz Y45wlH1Ur6i5Ter4H5uH/sEvLxcSQDY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Dj7+8fB4; spf=pass (imf14.hostedemail.com: domain of fmdefrancesco@gmail.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=fmdefrancesco@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670454213; a=rsa-sha256; cv=none; b=fYQogCsGff37gQ/PdVKccYXB4wCVxWk3+AZC+QU5xJK9jgErUfgwGMCExtDhZiHz/5SetJ WZF/bLdHqp8fZ51mUaqnhBTGb0AIJt/rpT6SnsQBzbNJsFcgBP7wDWCi2cwB4DvGKCoFPV Zz66H6KQZpjxlpjiJRJFHWz3tB5XpL8= Received: by mail-wr1-f44.google.com with SMTP id u12so29367268wrr.11 for ; Wed, 07 Dec 2022 15:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OlRZXX5fi6uW5Xh2LMxBmgQ7B0VSc2snpywNu1tW4NI=; b=Dj7+8fB4fw+2QdujWiQxxIkZgbFUihxLnxAqCWqnmVuceiC+w7/oGLydRxSI7h1lxB 0peNzyiiz8uSh+9+kRzGEx3zvrooMEIizeOgE9Flas/91C6+0QiUG9aR8Xeqp4IFVyop XTcm1uOr54A4qTUerg0bCDlZlGTWu3yJDT+RiJstPURbVDVqmtrRXr2I1L9grF/OMarv Ex1mp9qXeju8NSruHmXe1/pUwQZDWs4+GSNM8DHYTSwg+CyFCjBs9nFuBWy0g9ZJ1fp5 xAiNNao7DWjsUizxjzc/3NbOaxUcAUIX0Mr3TZ4Umm7h6e9/p5jJogeEnFqgCnP4D+u/ Q4Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OlRZXX5fi6uW5Xh2LMxBmgQ7B0VSc2snpywNu1tW4NI=; b=E41hyXvS0bGltLRvvrC5uOb0Qb0x8f0WumCLsZk12nqdwCVLmJUsDiUnkagUosj+nr r6It9IJjk4ysxDYO5z/oMkCYKdJYBeBPSNyNUd4iQiw5eioGZpivoMoWEcVweqM9xDfq 9/I0d5Vjsu7N4NN5yCmkopBpEswaJ/k/0pqwPaP/IXbJFrt6Qt3bJ17pGfUIgsjaGQPK tHKZIbAeCn6CB2N9CUdQ/Vj+abPWinnjL5MAELQ74aoqQC2J9nbBW9FcnTKOIUByzttw Zsge5Asymdltcl5hisegcEUCOzgMoamPBOVTAc5Iweat0N4hsDq2pFTgwKc54Vv6fo/O 1DMA== X-Gm-Message-State: ANoB5pmeVr+8IOZ9TeizgH6tvFMsqO9C9Qo73VsJBKVUWDnziuQ4yacn AamY7jCnJI7hnQua5hNVUQA= X-Google-Smtp-Source: AA0mqf7yPyQJ2OMGmt1h3CHkgXUOQGZMRlLGjTpfZ4OLsXZ8b3/7Xixr/sKd6B9TeKRcQ1e9ZglxMg== X-Received: by 2002:a05:6000:104a:b0:242:257f:56f8 with SMTP id c10-20020a056000104a00b00242257f56f8mr691030wrx.11.1670454212122; Wed, 07 Dec 2022 15:03:32 -0800 (PST) Received: from suse.localnet (host-79-26-108-238.retail.telecomitalia.it. [79.26.108.238]) by smtp.gmail.com with ESMTPSA id cl8-20020a5d5f08000000b00241fde8fe04sm20994245wrb.7.2022.12.07.15.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 15:03:30 -0800 (PST) From: "Fabio M. De Francesco" To: Sebastian Andrzej Siewior 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}() Date: Thu, 08 Dec 2022 00:03:29 +0100 Message-ID: <2263204.ElGaqSPkdT@suse> In-Reply-To: References: <20221206070029.7342-1-fmdefrancesco@gmail.com> <2130641.irdbgypaU6@suse> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: B93B5100018 X-Rspam-User: X-Stat-Signature: nrggo8eb9upkg84icb51uoy7ufm1ne88 X-HE-Tag: 1670454213-592183 X-HE-Meta: U2FsdGVkX1/dx20YeZuQofTOwNnxiEr61PPl8gBbwNmgPNOMoO3Lxpdra6jVGNXEsEg1Qp3my9WfOLcUp62azldU9qaEUN3OYAYtYpDaOm0S3WmP/GeRv9Udx9CjdidSSLfNpGCdmM6H9OrEn2BTFdMUtF31Jtgws7n1TL3fbeITAjZ1QzHjZoxEGhTBkegDy3glPrumGVfwpYDTQRE8ct85oGZxqeU2wZoPK2c1soF91coSCix8tO2ESU0uJzQaU/s4hUsN3VNmB6Czrdb54ioFy6p1TzPhxrU1mSG2VbiPiDBsQhLztOApfNTuVU+5wIbSVtsfen+HaiUGp0mY8hoEDF8S1lKFCacd35L7NObVn8GJ8D0QtkdlgmPWiC5G8/JttsBYMsmAYTbk1NQ366pVssnQ+6+da4effaEfZxkkrcI5PgtpX4BzHTuo6VbJAW26A3wssq0/gWEhOj/pbX/xI5gSHYGioeZVCV73C6eM7Xn97VRTRiRTZfL0MBhOHl5iBv6IuRukrerqrSU4st3DReLCQ5jTpmzY+sRpCHkm9NecumSGJZdhVUVIrxFOOxqxwb2QMcnq893xzMhJkiLWBL6JurMo0Ui3zOsmtC/j2B2ueme/aJ4AdgzuJAObjcKflAnKZ/8Gd62L8hefw+i60+kOu+DLcGD7nK1y9iYjLQfcDfrtwlnr14g8RdtXUVwlOLnWMzosQJcUlgr8i10kiZaDw8JsLQI9NOSKhsqyNOTOVo58Qs/jUbgBKI8Kf7uiwZCh3+ncB5Dy5g8RJrVA+02qv8vROXkx/y7AhDB9AZD1mBlCb/K9GJpjEUd7LZCwci3OuQJAitPNeM8ajm5eBgStL4hUVu05ijFxG7b7NLv5ZtXUJTXkcC4+xP0zCdiyVriiQRv54c0a+keBjYGCe23fQ1HoAQL+WUDWMfbUjZsizmJPc7Vmi1y5OtoHZJgACp6xGaOLXigPNSz 6faX2WVU bmaoVRL2i1nNbKjhIY2FvcUS+w7EPPl16ae886VtM3j3/xcJBLe2SNOm8bm8OUdE5qXrdXHCke1uqotRedKNrSIaVQ86iAUs7CloNxrFcIDMh7ORLuKZRsArANkWslLoPSEqq X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On mercoled=C3=AC 7 dicembre 2022 14:51:00 CET Sebastian Andrzej Siewior wr= ote: > 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 phr= ase > > > > before > > > > your suggestion. What about making it to become "For the above- mentioned > > > > 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 > > and/or preemption. I was only trying to say that developers must carefu= lly > > check whether or not the whole kmap-ed section depended on those side > > effects. > 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 >=20 > > If so, they must _explicitly_ disable preemption or page-faults or both > > together with the use of kmap_local_page(). >=20 > 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. > So ideally it won't be used ;) >=20 > > Instead, if the section=20 doesn't > >=20 > > depend on preemption and/or page-faults disabling, they must only repla= ce > > kmap_atomic() with kmap_local_page(). >=20 > Correct and I assumed that you know all this. >=20 > > I had probably used a bad wording when trying to say the same things th= at > > you > > wrote much more clearly. >=20 > Write it as you wish I just made a recommendation. If the wording is > crystal clear then there is less room for interpretations. I just sent v2 of this patch.[1] I hope that now I left less room for=20 potential misinterpretation by merging your suggestion with the old text. Again thanks for helping, =46abio [1] https://lore.kernel.org/lkml/20221207225308.8290-1-fmdefrancesco@gmail.= com/T/