Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2507998pxy; Mon, 3 May 2021 01:24:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdPDNjbbZZDI329Vh/MIBZ3LcBPRd7Uz8SNquj0Sh88rndD+Ecv1L2Vl87Tii0wFeA6+bI X-Received: by 2002:a17:90b:249:: with SMTP id fz9mr13068785pjb.162.1620030277679; Mon, 03 May 2021 01:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620030277; cv=none; d=google.com; s=arc-20160816; b=pWLUGURcIPC9waHClxgsuyR/6W1onGsoQkFzBQ0cEe5zr7LK3uYBxo2guVJZLaIPlX r9jLj7BzLx62HSulEJ7ariu+P6QS4v/qbIwSQRqqmHdSaoznLLwcio82Ljr8IfGn0Us6 n6t9GbAhx8s4xCAlgA3KyHWfhTT2VKQi8DXsdKKDyHH81r7b/lr/LMHbk1Trqxp6BThg FE08c9htzPybw1xpJWur541OH3T7zIIDaHwejSm3l2Wm6MSB/B7ouvLBAtzyeCgtld8/ z7/mi1tKPTba7HWfwPB6+Qh1kiBDH90OZGq2rprm+l7rDrmbVrNwazPjlAK7kx1/Fq+5 6LQA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bPRJDN7+PYmkwRc18YCW4pqF1oNECdl7EEdKg52HHCc=; b=hKZmFnDiBoJsQAyS9bEmC1vizbPc6gvrbG63hmreha0rEv1YdM5guifWUgKYlkUN/z 8OMjiw4thzVOGHBH30vj+o3ZHUlbQs/Yiay9yMwIr3YwTZPn7cnXvDnfmEV2MJKRa0tj EV7eO456jgAWK2kfMLBghpPzK+MEtM7n9JjdKq7IFDRkVEun1SRVGh9sX2hIdHVgXbcy tbPpsJEIlmAPWK4opsGH/qjXIAC0EXtQ1mYcgdV5Q37xqtyRtKwEoYFEzHTN7Kv/rVvZ ncHkZYw1cM6QUqahh3X1RkaMwrcsor8jwEMV8S8/S+1EJxl0rugJIY8wh9NrB0k6N68k crsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Fqv1CKmp; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w7si13613001plc.2.2021.05.03.01.24.24; Mon, 03 May 2021 01:24:37 -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=@redhat.com header.s=mimecast20190719 header.b=Fqv1CKmp; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230364AbhECIYr (ORCPT + 99 others); Mon, 3 May 2021 04:24:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39475 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbhECIYq (ORCPT ); Mon, 3 May 2021 04:24:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620030233; 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: in-reply-to:in-reply-to:references:references; bh=bPRJDN7+PYmkwRc18YCW4pqF1oNECdl7EEdKg52HHCc=; b=Fqv1CKmpzWBTP+UKgI2KLnpypJ7YI1FGaAC5ceOYbBqRLt+KLhVY7PpDTytrFhbB+LDS0G zNIJBmYurkTJL/Nu6SnsSK9vsPwM6sqI+wtMY4kM0hN6zQyoQhuZSO8eglHCsrdUkHtr+R h/995ta/61e6INyW6UcY4lJ8PLv5+pQ= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-315-nYUWEmpzNfWDXjpey9tuqQ-1; Mon, 03 May 2021 04:23:52 -0400 X-MC-Unique: nYUWEmpzNfWDXjpey9tuqQ-1 Received: by mail-wr1-f72.google.com with SMTP id r12-20020adfc10c0000b029010d83323601so3446816wre.22 for ; Mon, 03 May 2021 01:23:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bPRJDN7+PYmkwRc18YCW4pqF1oNECdl7EEdKg52HHCc=; b=SmpS4B1gZsQEfR7WjYaJslQJMcWrJxvco0iRLZJpZQf4+O7aZv4OeN045sxtqE0EYS 0EOo0j3dIrwGRO2u9lGvchAkqjHVh6Obm3m/ARH5ZB/VyCUvJgnoOS1TTt50wIH09GDB Ak0d/ROZ/YQIM3IP7787Tpw8YSX8NjtJRq+fsvoV1a/Mw3RUuw1DgAMD2HrjbFLRah99 0dG7pvEy2BBhT9IpU9TKHKhs6ZQtNxVX82f98w2HL/Qekf/VIqwWZDZY4jEuTkEtEElo XE1EOQgLjj/yWkJt1dndTsXj36KAqEhH8A3NPVdC+7CwrPFTUMh3utYxllGA/eNKnaay ZaHw== X-Gm-Message-State: AOAM532XrESJgmk6n/0knQNB9Gzcu9KlGCsIaN/0/riDCvYbSba5OYdI y1+OYLoMw4okchcWwyGtojWG4if173IXRIJNNYeTD1UZs7zAJtmLYKP2lbLzUCjgeOgG3T4b7Y+ UmOuG/MVMTtImibv5etWN3q70 X-Received: by 2002:a05:6000:184a:: with SMTP id c10mr23619879wri.237.1620030231114; Mon, 03 May 2021 01:23:51 -0700 (PDT) X-Received: by 2002:a05:6000:184a:: with SMTP id c10mr23619863wri.237.1620030230987; Mon, 03 May 2021 01:23:50 -0700 (PDT) Received: from redhat.com ([2a10:800a:cdef:0:114d:2085:61e4:7b41]) by smtp.gmail.com with ESMTPSA id n22sm8177060wmo.12.2021.05.03.01.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 01:23:50 -0700 (PDT) Date: Mon, 3 May 2021 04:23:47 -0400 From: "Michael S. Tsirkin" To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, Andrew Morton , Jason Wang , Alexey Dobriyan , Mike Rapoport , "Matthew Wilcox (Oracle)" , Oscar Salvador , Michal Hocko , Roman Gushchin , Alex Shi , Steven Price , Mike Kravetz , Aili Yao , Jiri Bohac , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Naoya Horiguchi , linux-hyperv@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v1 6/7] virtio-mem: use page_offline_(start|end) when setting PageOffline() Message-ID: <20210503042220-mutt-send-email-mst@kernel.org> References: <20210429122519.15183-1-david@redhat.com> <20210429122519.15183-7-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210429122519.15183-7-david@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 29, 2021 at 02:25:18PM +0200, David Hildenbrand wrote: > Let's properly use page_offline_(start|end) to synchronize setting > PageOffline(), so we won't have valid page access to unplugged memory > regions from /proc/kcore. > > Signed-off-by: David Hildenbrand the patch looks good to me as such Acked-by: Michael S. Tsirkin Feel free to merge with rest of patcgset - it seems to mostly live in the fs/mm space. IF you respin, maybe add the explanation you sent in response to Mike's comments in the commit log. > --- > drivers/virtio/virtio_mem.c | 2 ++ > mm/util.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c > index 10ec60d81e84..dc2a2e2b2ff8 100644 > --- a/drivers/virtio/virtio_mem.c > +++ b/drivers/virtio/virtio_mem.c > @@ -1065,6 +1065,7 @@ static int virtio_mem_memory_notifier_cb(struct notifier_block *nb, > static void virtio_mem_set_fake_offline(unsigned long pfn, > unsigned long nr_pages, bool onlined) > { > + page_offline_begin(); > for (; nr_pages--; pfn++) { > struct page *page = pfn_to_page(pfn); > > @@ -1075,6 +1076,7 @@ static void virtio_mem_set_fake_offline(unsigned long pfn, > ClearPageReserved(page); > } > } > + page_offline_end(); > } > > /* > diff --git a/mm/util.c b/mm/util.c > index 95395d4e4209..d0e357bd65e6 100644 > --- a/mm/util.c > +++ b/mm/util.c > @@ -1046,8 +1046,10 @@ void page_offline_begin(void) > { > down_write(&page_offline_rwsem); > } > +EXPORT_SYMBOL(page_offline_begin); > > void page_offline_end(void) > { > up_write(&page_offline_rwsem); > } > +EXPORT_SYMBOL(page_offline_end); > -- > 2.30.2