Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp956849ybt; Tue, 7 Jul 2020 04:31:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuxXlmt7Nqm5eqyPK7/G7K3fMN3khcG3NchAntM/Tu91Fqj3D4PIWk7kWrhtnP4052ZiTD X-Received: by 2002:a17:906:1c4b:: with SMTP id l11mr45927226ejg.307.1594121510303; Tue, 07 Jul 2020 04:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594121510; cv=none; d=google.com; s=arc-20160816; b=UgBkc89RPdtogO+SjFYtFKfoY2kGpfkbkUfG7ElJaEY/CWRXbbotZiU+HxGKHWHwUM eEXuLVdY/DbEjhsYJMCz0QIw8VCpcXsuD5HOUHm76CrR/QuukSpBfDIYXV8CRSRYk/tk XRyX9Ea2CnAB1PhUFIiUJL77HC7W6cs1+amsC7FJdovRmxOJFdq0oO+ikkqxI3EaOaW+ NRs+JMX4roE6KxMEdpjwPxAYzWvrWsA7JMSd0wbsEhVlt1qsXiXtJjBvOxwwKcL3TFRm O+qi0owuMBx8SwQPWEdwH9FW7of6UlfVvqIWu1gLfujr72c+xeL9S74ZMlMO6EoFR6e9 YJ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=oU+zHS1dWLePXpv1roLop07qC5/+PHNWookUwJLe/zU=; b=rgTMeWEWwRpOQcuQbiXHtsvcyactZabsAiTu+uFjyofwGCPYz2vzTFwF7hS9TtYzvB eXZKXoNAoUruFFxJHmM/65BEF90Nq5eaOST0DPfDVm6zxk5kPsFafzinOFQrE2TjJqdV eJiwUmstUfp7mylqMtJJSF6eP21Y8bAczoaZzwt9cfpbK+KMRg1DYd5Py4ObDJX3gJbR rgXxO7/9xi5w/joM/GnKpBH86sByXfFKwm/hmYv2op0cRLzbZgGczceVVmS0pbCfe5fT 4bT+sTqBe+5zD0E51CCM7g7rdaG+0LHIZKIgFo2Q3fmd6rQFKbSZxyclgg7hXhmsf9qe HFmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HzqoVfv5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si14781749edr.480.2020.07.07.04.31.26; Tue, 07 Jul 2020 04:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HzqoVfv5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727827AbgGGLbD (ORCPT + 99 others); Tue, 7 Jul 2020 07:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726540AbgGGLbD (ORCPT ); Tue, 7 Jul 2020 07:31:03 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D33DDC061755 for ; Tue, 7 Jul 2020 04:31:02 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id 9so49426372ljv.5 for ; Tue, 07 Jul 2020 04:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=oU+zHS1dWLePXpv1roLop07qC5/+PHNWookUwJLe/zU=; b=HzqoVfv5RmJSiJec48Z3gyXEpw3X1xzcpa7yGskC4YP4FKDLYWnNwGMKx7bPp5Di7M tAPv4yoi7/blcmwpByoACwe0S74SDsfhbuSrSJbAMsKtYruaS6ia/LBd+13co+pkezkk 7ED8pj13E7YmJr85IrN0MVKjFyHLI0G0TJ73UB9v7WnD2zN0X7ICOOtfjGUQ0J71cnjP iYWwsuoH7p9DXqBStWZvc8pwrz62bilvgWSXrlKpRzl7c1aLuLFkvFYxt82/FhaGmybv fSUho90IdiLmF9K8hKcl976CmHjAZzritDhMnDBdK/WDiwPviUgXcEseAddmE8iDGBHE TFJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=oU+zHS1dWLePXpv1roLop07qC5/+PHNWookUwJLe/zU=; b=QEJ4oEPPGTr2YGGWn2rpBYiowNupwJZGZA/4Rzc/9GVsWNsHC24McZLa+FZ/8lA25I vnqjsdNE+YdyitT2k7aafiuJturXKGhi0bhuBpPrTxwR0JjtEBrHoo12pyBQoKSLYVah jYNQTm03MIxscE4P+0TUswrO/7W/1k0SXEHs8uROYcgKNCaTr9BhbFbr0Uz0fR6+Wv4b 4QkTvcBAJ0RuIL8xJeDk9IgvRH4hd4OjJ3dY739uYWPvPyIAkCRkCvlSRJUqlIVSJOHa RnvAh+xC9iuuCI8+cNeITD+279m2QR4B9y5V/QTzoXXG4q9g0vhGrLyQk5QHX9gXmCyu ClOg== X-Gm-Message-State: AOAM5332O8CuGJewXZXuaFNPdAqaoozSATc0PBILVoOoBNSgN57ZGNUt HaCO0e9iwrrTkXWTI0FZZB88qph0+MXBXD9sl2g= X-Received: by 2002:a2e:5d8:: with SMTP id 207mr28871025ljf.257.1594121461257; Tue, 07 Jul 2020 04:31:01 -0700 (PDT) MIME-Version: 1.0 References: <1594059372-15563-1-git-send-email-jrdr.linux@gmail.com> <1594059372-15563-3-git-send-email-jrdr.linux@gmail.com> <8fdd8c77-27dd-2847-7929-b5d3098b1b45@suse.com> In-Reply-To: <8fdd8c77-27dd-2847-7929-b5d3098b1b45@suse.com> From: Souptick Joarder Date: Tue, 7 Jul 2020 17:00:49 +0530 Message-ID: Subject: Re: [PATCH v2 2/3] xen/privcmd: Mark pages as dirty To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Cc: Boris Ostrovsky , sstabellini@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, John Hubbard , Paul Durrant Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 7, 2020 at 3:08 PM J=C3=BCrgen Gro=C3=9F wrot= e: > > On 06.07.20 20:16, Souptick Joarder wrote: > > pages need to be marked as dirty before unpinned it in > > unlock_pages() which was oversight. This is fixed now. > > > > Signed-off-by: Souptick Joarder > > Suggested-by: John Hubbard > > Cc: John Hubbard > > Cc: Boris Ostrovsky > > Cc: Paul Durrant > > --- > > drivers/xen/privcmd.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c > > index 33677ea..f6c1543 100644 > > --- a/drivers/xen/privcmd.c > > +++ b/drivers/xen/privcmd.c > > @@ -612,8 +612,11 @@ static void unlock_pages(struct page *pages[], uns= igned int nr_pages) > > { > > unsigned int i; > > > > - for (i =3D 0; i < nr_pages; i++) > > + for (i =3D 0; i < nr_pages; i++) { > > + if (!PageDirty(pages[i])) > > + set_page_dirty_lock(pages[i]); > > With put_page() directly following I think you should be able to use > set_page_dirty() instead, as there is obviously a reference to the page > existing. Patch [3/3] will convert above codes to use unpin_user_pages_dirty_lock() which internally do the same check. So I thought to keep linux-stable and linux-next code in sync. John had a similar concern [1] and later agreed to= keep this check. Shall I keep this check ? No ? [1] https://lore.kernel.org/xen-devel/a750e5e5-fd5d-663b-c5fd-261d7c939ba7@= nvidia.com/ > > > put_page(pages[i]); > > + } > > } > > > > static long privcmd_ioctl_dm_op(struct file *file, void __user *udata= ) > > > > Juergen