Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp855363rwb; Wed, 7 Dec 2022 05:58:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf6p2VOEN4cFbEmZTOc3Bj6OpET+HKeRf8mKtmYK4LRBT2ob95bKb8O4lgbc6yFp1e6dhxv9 X-Received: by 2002:a17:90b:3944:b0:214:1df0:fe53 with SMTP id oe4-20020a17090b394400b002141df0fe53mr103498489pjb.214.1670421485562; Wed, 07 Dec 2022 05:58:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670421485; cv=none; d=google.com; s=arc-20160816; b=GXmiKVlq7he6LWvbEUGimbAX5GwjijWUQn53AsirpWZ3gM8IUGGkENlOrkXNs/vsPQ ugpXjqe7gCBsh7rcq2N4bCiP7D1ulbqDeL3l8SbzUl+j/FRMA2aBlJDjh6NeGH7nSeyU xe+ZfQFPKJ0fOhEH3Nv5qxSD7lhOQiJuVkmt++FnWtsMItSxfKjJC3yeUp9y4/jc/S6e ABHLQPLFmdvCkelc6UwnfSm/EIzeZcRJ2oTwxIMKeSLwytzDKsg7R63uUy9SPxH4u/oc 18VXhha9C5H7HyhtWZuJKdKMDhNXe2lphIFOpjnsaPeQJ+ws/4kusNyg6auRP+3s7tn3 39vA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=mx4FrQXn0z6frpjJL58zvvJiiJEsdejNIy8r20RlzLQ=; b=RhYRhpgWBhr1y6Rv33q7vahtdIxIVnBBgBPwTzdDLwDfhf53GkczLfHKGtViCTr2C/ ApxeRVEqQEAh4uAoVtSirv8VzWVs/4b12UVlyFvVHwflMRXoeqJdLZc14nEFanWzzG3k YdELTtMQUB8sPbKMW6E3cUI7Icfub1a78Bbm9Uv+68LPvx4PDIwL7GNXN5GdkJJIgovJ eGCDwS/l/QaB7NHsA4y5wdsb/95/lf/p8faAmBV9UZh97KNzbn9g9KBd0cumkJr7xHw5 i3L9i7jXvkHcmfVVPpKiKTTo6oGsjI3uBHpxjFU7bbjl5Pw3sdphK3mNfD7pyvtxTZeK hDbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fhgAF5VZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=VwIcAmFo; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f18-20020a63f752000000b00476f0b7d1f1si20607534pgk.804.2022.12.07.05.57.55; Wed, 07 Dec 2022 05:58:05 -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=@linutronix.de header.s=2020 header.b=fhgAF5VZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=VwIcAmFo; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbiLGNvO (ORCPT + 75 others); Wed, 7 Dec 2022 08:51:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbiLGNvK (ORCPT ); Wed, 7 Dec 2022 08:51:10 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0478F59172; Wed, 7 Dec 2022 05:51:04 -0800 (PST) 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 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