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 X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F6EFC2BA19 for ; Tue, 14 Apr 2020 16:35:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E4C05206E9 for ; Tue, 14 Apr 2020 16:35:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YsExl9OB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4C05206E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 65CC18E000C; Tue, 14 Apr 2020 12:35:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60D2A8E0001; Tue, 14 Apr 2020 12:35:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5238A8E000C; Tue, 14 Apr 2020 12:35:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3BB348E0001 for ; Tue, 14 Apr 2020 12:35:20 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 01232249C for ; Tue, 14 Apr 2020 16:35:19 +0000 (UTC) X-FDA: 76707010800.05.smile46_116983b92a32a X-HE-Tag: smile46_116983b92a32a X-Filterd-Recvd-Size: 5112 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Apr 2020 16:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586882118; 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=8NcFHCl/3J2x3mxr7YcT3b4sDJ17twsVgnft0orOFS4=; b=YsExl9OBYKb9cuM1qx5G0WAw+d8ct80KJsL28jK7DzNcJxbM3lvXVtF367AwGqpjELjBOJ +VIV6nQAfrnK66zP+BeOujvGcMw2UmjP9AOyTyRXeh9wsdFBGrRpGkO9coMz+iwZFCYptb CFf2iXFw87/xI8ih8Mn2R8RAy913gsU= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-197-97E6Z2wiPS-zCtXTjUxtTA-1; Tue, 14 Apr 2020 12:35:08 -0400 X-MC-Unique: 97E6Z2wiPS-zCtXTjUxtTA-1 Received: by mail-qv1-f71.google.com with SMTP id v4so329936qvt.3 for ; Tue, 14 Apr 2020 09:35:08 -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=a+z0V7RnGWnuMpMvNgwDiJGASaPb4ctVzlcABrxuV4A=; b=OalYsbB+7uAi2zPf4pWsbTSosW18++f9Ta/Kk3yftrD4xGXpYhcU7r2VjEG59uZqUL TMu2N3ATzpruMV/Uc+/7rQrTLRTAjyFWZSdET91AfDo+hGiWJdG7oeE1JpDg+9iWwYFQ utqzzGQ9HUKIFdlzsXFaEOTGYVPLVUPOfNnJEwF6zAxE4nh1E2F4himgGRplZrkU9pQc Iaj03hcF82WEG38yMVzqBeA/gwb7K/tGobISNw2UdxWvbqD9fABnWngBHtL+c+D+oDGl g2G3E1g/qVb+k1MdsIo3qcVxzBisBDGrBDrsjGGL32+GhW86XeEDakHgWXT6bv8LbXNv JGLg== X-Gm-Message-State: AGi0PuYXg4T5YbR7t4a22mU73+YKvqzUXoxSxnRyZDZhYNb/nq74z3um JJW8nJIgCfT5dbE2hYsHXLHHdZx9ht1eeGnsFRvSs15S1RvOF2Le4FDAJMCZB+0MtWHuIOXxtT4 GuZfG3epGzBo= X-Received: by 2002:ac8:1a8a:: with SMTP id x10mr16745175qtj.154.1586882108242; Tue, 14 Apr 2020 09:35:08 -0700 (PDT) X-Google-Smtp-Source: APiQypIakUO2krHIWdvhEXYjqdm92gTrXC3mv7zDEqds8YLz1XE2H5AqLw7LE95UTq5xyYwXK4VCyA== X-Received: by 2002:ac8:1a8a:: with SMTP id x10mr16745153qtj.154.1586882108008; Tue, 14 Apr 2020 09:35:08 -0700 (PDT) Received: from redhat.com (bzq-79-183-51-3.red.bezeqint.net. [79.183.51.3]) by smtp.gmail.com with ESMTPSA id f1sm10297177qkl.91.2020.04.14.09.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 09:35:07 -0700 (PDT) Date: Tue, 14 Apr 2020 12:35:02 -0400 From: "Michael S. Tsirkin" To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, Michal Hocko , Andrew Morton , Oscar Salvador , Michal Hocko , Pavel Tatashin , Wei Yang , Dan Williams , Qian Cai Subject: Re: [PATCH v2 07/10] mm/memory_hotplug: Introduce offline_and_remove_memory() Message-ID: <20200414123438-mutt-send-email-mst@kernel.org> References: <20200311171422.10484-1-david@redhat.com> <20200311171422.10484-8-david@redhat.com> <156601a9-e919-b88f-2278-97ecee554d21@redhat.com> MIME-Version: 1.0 In-Reply-To: <156601a9-e919-b88f-2278-97ecee554d21@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Mar 11, 2020 at 06:19:04PM +0100, David Hildenbrand wrote: > On 11.03.20 18:14, David Hildenbrand wrote: > > virtio-mem wants to offline and remove a memory block once it unplugged > > all subblocks (e.g., using alloc_contig_range()). Let's provide > > an interface to do that from a driver. virtio-mem already supports to > > offline partially unplugged memory blocks. Offlining a fully unplugged > > memory block will not require to migrate any pages. All unplugged > > subblocks are PageOffline() and have a reference count of 0 - so > > offlining code will simply skip them. > >=20 > > All we need is an interface to offline and remove the memory from kerne= l > > module context, where we don't have access to the memory block devices > > (esp. find_memory_block() and device_offline()) and the device hotplug > > lock. > >=20 > > To keep things simple, allow to only work on a single memory block. > >=20 >=20 > Lost the ACK from Michael >=20 > Acked-by: Michal Hocko [1] >=20 > [1] https://lkml.kernel.org/r/20200302142737.GP4380@dhcp22.suse.cz Andrew, could you pls ack merging this through the vhost tree, with the rest of the patchset? > --=20 > Thanks, >=20 > David / dhildenb