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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E2F2C433F5 for ; Mon, 30 May 2022 07:53:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD9BC8D0010; Mon, 30 May 2022 03:53:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B8BD98D0001; Mon, 30 May 2022 03:53:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4E9F8D0010; Mon, 30 May 2022 03:53:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 94E528D0001 for ; Mon, 30 May 2022 03:53:35 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 658EE60916 for ; Mon, 30 May 2022 07:53:35 +0000 (UTC) X-FDA: 79521644790.04.6CA6C90 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 68A5280048 for ; Mon, 30 May 2022 07:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653897214; 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=lW8fZRkPKfhJnNOw18gq2IWP/lJEsxr/x1aT3dj708I=; b=SCujWkYkawSu5Ur9OUPTVS+UIXCRpPPQBM4ZPnGCeGu3Swpx9lYuJx7d5KmECJL1MOc7nw iLdhVaePuXBn56v7KRnIeZzhlCJhWxKf6E/e2iB439uag+R4Sy0u4YB2g3Jac4UOge88qA 2uUw9EdOYwCF/BWEhZ3Y/c8dFpjMhl4= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-660-He_YfpUpM3WJ5qLvmAdiOQ-1; Mon, 30 May 2022 03:53:33 -0400 X-MC-Unique: He_YfpUpM3WJ5qLvmAdiOQ-1 Received: by mail-wr1-f72.google.com with SMTP id e24-20020a5d5958000000b0020ffd1d62b2so1437158wri.17 for ; Mon, 30 May 2022 00:53:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=lW8fZRkPKfhJnNOw18gq2IWP/lJEsxr/x1aT3dj708I=; b=hM2h/DMISL2tf73t+IkmgcOdaJJO0RuvkcUbKBXDQbvxlhPu1vuJEtJmCUn+UbKBGy 3znVdpM6f6hiG38WSRwjTODBcLhTqVJOBI1DYbEI0HHq0jHNc5zjfXIdXGjwRUElSqTw /GOrL9Bo+YO10oo2chllWQ7yTMxECm8Ji0nMrBmnNliiyN0sH2vHZWfh2sNp+Vgx5QMP zPbAaelCyM8q4VsMIjhxL/+NUMUp4x9G1kwZw2z85QHSWkO9bv/rNd7R0D922awjhsn2 q2lM+jdUfSKO2XxNQhL5vl2l9HljJh2f1qCG1XjWRz5fVkDHkN9HunpMdDLpGQ6uHTlP jY9Q== X-Gm-Message-State: AOAM531xpwl1XViZxGHRf+B4Vo4WONyFO/3nHYB4gY5x2LJxUmFIhnCG tMZk0cpHjNCai8c7lGl/3ULxxCA9e6JExWmqI4J+wZX4KBkT3J7kDiODUKJXl0cnMQd2EDUcsDs 4IvCZupNymKc= X-Received: by 2002:a05:600c:3543:b0:397:7565:ea4 with SMTP id i3-20020a05600c354300b0039775650ea4mr17556024wmq.86.1653897211922; Mon, 30 May 2022 00:53:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXMX0mVia1YfTVILgUPjxKu9Fq37hgGHboYr/arqWNq5GxPQTIQAE8Q8/KSnUDs6PSNUeh1A== X-Received: by 2002:a05:600c:3543:b0:397:7565:ea4 with SMTP id i3-20020a05600c354300b0039775650ea4mr17555999wmq.86.1653897211629; Mon, 30 May 2022 00:53:31 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:7c00:aaa9:2ce5:5aa0:f736? (p200300cbc7047c00aaa92ce55aa0f736.dip0.t-ipconnect.de. [2003:cb:c704:7c00:aaa9:2ce5:5aa0:f736]) by smtp.gmail.com with ESMTPSA id l6-20020adff486000000b0020c5253d907sm8266521wro.83.2022.05.30.00.53.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 May 2022 00:53:31 -0700 (PDT) Message-ID: Date: Mon, 30 May 2022 09:53:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 3/3] virtio_balloon: Introduce memory recover To: zhenwei pi , Sean Christopherson Cc: akpm@linux-foundation.org, naoya.horiguchi@nec.com, mst@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jasowang@redhat.com, virtualization@lists.linux-foundation.org, pbonzini@redhat.com, peterx@redhat.com, qemu-devel@nongnu.org References: <20220520070648.1794132-1-pizhenwei@bytedance.com> <20220520070648.1794132-4-pizhenwei@bytedance.com> <79d17b10-3532-57d4-e70c-3ccf1ab0d87d@bytedance.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <79d17b10-3532-57d4-e70c-3ccf1ab0d87d@bytedance.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 68A5280048 X-Stat-Signature: 9asr6w7p1dz6ru4h7dosfgugc6omu9ik X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SCujWkYk; spf=none (imf02.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1653897210-479331 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 25.05.22 01:32, zhenwei pi wrote: > > > On 5/25/22 03:35, Sean Christopherson wrote: >> On Fri, May 20, 2022, zhenwei pi wrote: >>> @@ -59,6 +60,12 @@ enum virtio_balloon_config_read { >>> VIRTIO_BALLOON_CONFIG_READ_CMD_ID = 0, >>> }; >>> >>> +/* the request body to commucate with host side */ >>> +struct __virtio_balloon_recover { >>> + struct virtio_balloon_recover vbr; >>> + __virtio32 pfns[VIRTIO_BALLOON_PAGES_PER_PAGE]; >> >> I assume this is copied from virtio_balloon.pfns, which also uses __virtio32, but >> isn't that horribly broken? PFNs are 'unsigned long', i.e. 64 bits on 64-bit kernels. >> x86-64 at least most definitely generates 64-bit PFNs. Unless there's magic I'm >> missing, page_to_balloon_pfn() will truncate PFNs and feed the host bad info. >> > > Yes, I also noticed this point, I suppose the balloon device can not > work on a virtual machine which has physical address larger than 16T. Yes, that's a historical artifact and we never ran into it in practice -- because 16TB VMs are still rare, especially when paired with virtio-balloon inflation/deflation. Most probably the guest should just stop inflating when hitting such a big PFN. In the future, we might want a proper sg interface instead. -- Thanks, David / dhildenb