Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp146992rdb; Tue, 19 Dec 2023 11:57:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDJ8CUb+qA+WDQSUwv52jr0pJSDHamxQhuBl1sgKk2qpg4cDwMRGRolUR22hfm5xpyaY9Q X-Received: by 2002:a05:6870:f80a:b0:1fb:75a:c427 with SMTP id fr10-20020a056870f80a00b001fb075ac427mr19735115oab.80.1703015843348; Tue, 19 Dec 2023 11:57:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703015843; cv=none; d=google.com; s=arc-20160816; b=Qki4iSKw4NRxmZGViI/gk+nGWYSw5xBSVhfF+oPfEcxYzo3shFVp7V6ynhG9yuP1UG xeQXppffipa8nsgxTucWNy+yX+pFOLiZv530+tFuVBDDffJTRgC+dvK/xQ4sHrKn1gox DcuUjcPU/R+IJCBeqhOLi0QCk42cZxa3k1GbH/3vIOBemNGXFFqeZhDHKTyoJECmHqge KRbu3AOGd/CtBYB7GkG2GsytokYHTKAnak3Msm9R0nPZrmwTKj+V34lK9OpRyJIrEhVL wheiOaSAtBs8bFtPXE7iBjcTnBQ7CbJQVE7Y70KHWisVE+EvBM5LAUclVMnjvKB7J18E jDAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=5oCP0nwQO5wEOvgfd+3H9DFTIgN90szcGpyE0ltIP50=; fh=FRd+Wum6lb/U4KQ2FWX/YWVOeFKGWIEieTy0cFJeH/4=; b=TlkmApkNz9fZlUIXtN4pPNYBbgkc35x0xNzumzr9X0qyhg0UzwJSBcL/gtA5SMb4v8 Gbu8nVr/iAlgdMbI2Ok5Wz2Ay+dcQ3Vhk7IKY9bfNCZKhNouqvsVSeyva4SNe/XPM/am agqoUo/ZgIKksEHG/lmlz5x2gELuoMri/8SM0GtRMTbCkfVi4v+VPe9aQJ1LKjR6whYZ rrUWV5Sf+m16XEBlqQiw5XyUZ6FWkdaVXnq64LbrSjrMXuMJANKX4dAJQx5Ycacnc29e URW+0aoPgZ6GLLnYrN+UdpAHrLyuPTxc3jJJ5O2Va8af/ycYitUG3Vahket4yrMMD/AD dbHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5890-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5890-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e7-20020a636907000000b005cd7c0a35c2si6433711pgc.480.2023.12.19.11.57.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:57:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5890-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5890-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5890-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9B73E287138 for ; Tue, 19 Dec 2023 19:57:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF8FC39877; Tue, 19 Dec 2023 19:57:14 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29EB539AC2; Tue, 19 Dec 2023 19:57:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6d9d6f8485eso1085807a34.0; Tue, 19 Dec 2023 11:57:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703015832; x=1703620632; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5oCP0nwQO5wEOvgfd+3H9DFTIgN90szcGpyE0ltIP50=; b=gXDfyhqxzZcOKk3NzejaQK6CqiB+8kF2nQ6/tpKJm3EAS9YUDz5FX+YfuxW09DOlxm PQUzix9T8Rj1k2dLARm7FFqTA8+V0x3ztb08KgZ9351prSnQHWrQGQub2mhtI7Q45IsB XHec35lGdtyzE5Gsdz5hqUZbJ56MTMU6Oyzlo2nYrjJN/lQSRePW2iC+PFfZq/TFM41z 072vP6YgxONEZtX/6X4VjUCQ+xroYHAIG3I3YRwNHhJvVkeTcDKYPyHLV+VV+HzRToGi U/vvCuc92Ti8a3TPbPLX02q6a3IJt2fC0XFCo6BA/zhvpBG+hNV5aDxte8QkDfQnzi7/ cpiQ== X-Gm-Message-State: AOJu0YzDe8KTSnPnsI8EqvmNhQVeDPbdevQISf7hJsETH5HmoTnzuQwH 5GouunlYtaQ2HEN0+eyGFZw9t6esIrbDgasoNe8= X-Received: by 2002:a05:6870:b149:b0:203:bb0a:ea7f with SMTP id a9-20020a056870b14900b00203bb0aea7fmr8331289oal.5.1703015832187; Tue, 19 Dec 2023 11:57:12 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <19e305896a2357d305f955fa14cc379e40e512bd.1702977429.git.chen.haonan2@zte.com.cn> In-Reply-To: <19e305896a2357d305f955fa14cc379e40e512bd.1702977429.git.chen.haonan2@zte.com.cn> From: "Rafael J. Wysocki" Date: Tue, 19 Dec 2023 20:57:01 +0100 Message-ID: Subject: Re: [PATCH linux-next v2] kernel/power: Use kmap_local_page() in snapshot.c To: chenguanxi11234@163.com Cc: rafael@kernel.org, len.brown@intel.com, pavel@ucw.cz, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Haonan Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 19, 2023 at 2:19=E2=80=AFPM wrote: > > From: Chen Haonan > > kmap_atomic() has been deprecated in favor of kmap_local_page(). > > kmap_atomic() disables page-faults and preemption (the latter > only for !PREEMPT_RT kernels).The code between the mapping and > un-mapping in this patch does not depend on the above-mentioned > side effects.So simply replaced kmap_atomic() with kmap_local_page(). > > Signed-off-by: Chen Haonan > --- > kernel/power/snapshot.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c > index e3e8f1c6e75f..5c96ff067c64 100644 > --- a/kernel/power/snapshot.c > +++ b/kernel/power/snapshot.c > @@ -1487,11 +1487,11 @@ static bool copy_data_page(unsigned long dst_pfn,= unsigned long src_pfn) > s_page =3D pfn_to_page(src_pfn); > d_page =3D pfn_to_page(dst_pfn); > if (PageHighMem(s_page)) { > - src =3D kmap_atomic(s_page); > - dst =3D kmap_atomic(d_page); > + src =3D kmap_local_page(s_page); > + dst =3D kmap_local_page(d_page); > zeros_only =3D do_copy_page(dst, src); > - kunmap_atomic(dst); > - kunmap_atomic(src); > + kunmap_local(dst); > + kunmap_local(src); > } else { > if (PageHighMem(d_page)) { > /* > @@ -1499,9 +1499,9 @@ static bool copy_data_page(unsigned long dst_pfn, u= nsigned long src_pfn) > * data modified by kmap_atomic() > */ > zeros_only =3D safe_copy_page(buffer, s_page); > - dst =3D kmap_atomic(d_page); > + dst =3D kmap_local_page(d_page); > copy_page(dst, buffer); > - kunmap_atomic(dst); > + kunmap_local(dst); > } else { > zeros_only =3D safe_copy_page(page_address(d_page= ), s_page); > } > -- Applied (under edited subject) as 6.8 material, thanks!