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 A7891C433FE for ; Mon, 30 May 2022 15:49:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 038196B0071; Mon, 30 May 2022 11:49:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F2A486B0072; Mon, 30 May 2022 11:49:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC7DF6B0073; Mon, 30 May 2022 11:49:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C9AF96B0071 for ; Mon, 30 May 2022 11:49:30 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 68619120A32 for ; Mon, 30 May 2022 15:49:30 +0000 (UTC) X-FDA: 79522844100.06.BEAC691 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf11.hostedemail.com (Postfix) with ESMTP id 6D5C24001F for ; Mon, 30 May 2022 15:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653925767; 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=3rYstiXH+DFFxpN0eJSYZFfNb9vwPKdu6j6eGmXRMcc=; b=IkMn/wnk3O76rkoqEZ4YWdS3FAjFyWLgEpc9/64rbv97tM5pqhKUWRzVS2JPDJG8vAExbk 7Wj2LchN0yZCuNNgYVT0Y7vcJCW0RzGa7OFLzT6r1MZKsZQ9jhg4LO+tHtq902QmNtyEEZ FU8oac4LUtjSeoRcCl9duCxgjucOKvA= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-232-vYAmIsaSO02kl5SWHXMEMw-1; Mon, 30 May 2022 11:49:24 -0400 X-MC-Unique: vYAmIsaSO02kl5SWHXMEMw-1 Received: by mail-il1-f198.google.com with SMTP id b13-20020a92c56d000000b002d125a2ab95so8581679ilj.13 for ; Mon, 30 May 2022 08:49:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3rYstiXH+DFFxpN0eJSYZFfNb9vwPKdu6j6eGmXRMcc=; b=2KXQluGny4cZmVTK4MmY7h2Bgom3QfBtaIO3mbA8Vr/3mCcZYogv7JhaVBKoIWFPF6 sEAJ+JE9m8l0pDh/O5Wt8w2dQvVdve8K2rAJTph70DEnYmR2mffrOhpV6vTnyeTaOwTf NT4m1jLqb4B4XUf5JcbhaCMQPRnI3/s/IKeS+SIK/pYmOPNbzgLyy0Msu5FzWqSY09nY i4t9jnVP9ncPW30tyHBQwKhRtch+BiYsgDTOzXaYXHYJEMUQ/VgAnOTORzIqWmejLShS 82blW/5lzJsaKnpl3IQntvnsIgvPXZkWuHEbZIDIeUcXFli3on0Raop0H5rRuBcf1xRm 2mew== X-Gm-Message-State: AOAM532vk8uX+3CC/c+B+u1rJ+iOoPNK6ByvfDL95Ks9Vd2hko7wGCtA /zgiB9spGW9r/URilXbZ9kRqVJ/b4okv7MyhsyxufjmKE2f1cPGrHk4oGHbQkRoejCAspodMuBd 0NM6xbV5EAkU= X-Received: by 2002:a05:6e02:1c4e:b0:2d1:a8d:e94d with SMTP id d14-20020a056e021c4e00b002d10a8de94dmr29213937ilg.194.1653925763932; Mon, 30 May 2022 08:49:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyavXgOOvyHvCgnhXUybuBh2qRd2Dsuuan5kKliX95y7YWU6WnNJ4Q63813uIsXDGIP+OZk1Q== X-Received: by 2002:a05:6e02:1c4e:b0:2d1:a8d:e94d with SMTP id d14-20020a056e021c4e00b002d10a8de94dmr29213912ilg.194.1653925763620; Mon, 30 May 2022 08:49:23 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id u20-20020a926014000000b002cde6e35302sm3764514ilb.76.2022.05.30.08.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 08:49:22 -0700 (PDT) Date: Mon, 30 May 2022 11:49:21 -0400 From: Peter Xu To: zhenwei pi Cc: David Hildenbrand , Jue Wang , Paolo Bonzini , Andrew Morton , jasowang@redhat.com, LKML , Linux MM , mst@redhat.com, HORIGUCHI =?utf-8?B?TkFPWUEo5aCA5Y+jIOebtOS5nyk=?= , qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org Subject: Re: Re: [PATCH 0/3] recover hardware corrupted page by virtio balloon Message-ID: References: <24a95dea-9ea6-a904-7c0b-197961afa1d1@bytedance.com> <0d266c61-605d-ce0c-4274-b0c7e10f845a@redhat.com> <4b0c3e37-b882-681a-36fc-16cee7e1fff0@bytedance.com> MIME-Version: 1.0 In-Reply-To: <4b0c3e37-b882-681a-36fc-16cee7e1fff0@bytedance.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: 6D5C24001F X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="IkMn/wnk"; spf=none (imf11.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: mjx3sb3prx73gi8atpy5791wmcmg9d88 X-Rspamd-Server: rspam05 X-HE-Tag: 1653925760-467913 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 Mon, May 30, 2022 at 07:33:35PM +0800, zhenwei pi wrote: > A VM uses RAM of 2M huge page. Once a MCE(@HVAy in [HVAx,HVAz)) occurs, the > 2M([HVAx,HVAz)) of hypervisor becomes unaccessible, but the guest poisons 4K > (@GPAy in [GPAx, GPAz)) only, it may hit another 511 MCE ([GPAx, GPAz) > except GPAy). This is the worse case, so I want to add > '__le32 corrupted_pages' in struct virtio_balloon_config, it is used in the > next step: reporting 512 * 4K 'corrupted_pages' to the guest, the guest has > a chance to isolate the other 511 pages ahead of time. And the guest > actually loses 2M, fixing 512*4K seems to help significantly. It sounds hackish to teach a virtio device to assume one page will always be poisoned in huge page granule. That's only a limitation to host kernel not virtio itself. E.g. there're upstream effort ongoing with enabling doublemap on hugetlbfs pages so hugetlb pages can be mapped in 4k with it. It provides potential possibility to do page poisoning with huge pages in 4k too. When that'll be ready the assumption can go away, and that does sound like a better approach towards this problem. > > > > > I assume when talking about "the performance memory drops a lot", you > > imply that this patch set can mitigate that performance drop? > > > > But why do you see a performance drop? Because we might lose some > > possible THP candidates (in the host or the guest) and you want to plug > > does holes? I assume you'll see a performance drop simply because > > poisoning memory is expensive, including migrating pages around on CE. > > > > If you have some numbers to share, especially before/after this change, > > that would be great. > > > > The CE storm leads 2 problems I have even seen: > 1, the memory bandwidth slows down to 10%~20%, and the cycles per > instruction of CPU increases a lot. > 2, the THR (/proc/interrupts) interrupts frequently, the CPU has to use a > lot time to handle IRQ. Totally no good knowledge on CMCI, but if 2) is true then I'm wondering whether it's necessary to handle the interrupts that frequently. When I was reading the Intel CMCI vector handler I stumbled over this comment: /* * The interrupt handler. This is called on every event. * Just call the poller directly to log any events. * This could in theory increase the threshold under high load, * but doesn't for now. */ static void intel_threshold_interrupt(void) I think that matches with what I was thinking.. I mean for 2) not sure whether it can be seen as a CMCI problem and potentially can be optimized by adjust the cmci threshold dynamically. -- Peter Xu