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 92EC4C433F5 for ; Fri, 29 Apr 2022 22:53:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D03226B0071; Fri, 29 Apr 2022 18:53:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C89B26B0072; Fri, 29 Apr 2022 18:53:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B365B6B0073; Fri, 29 Apr 2022 18:53:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 9D4556B0071 for ; Fri, 29 Apr 2022 18:53:27 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6FA1C281E1 for ; Fri, 29 Apr 2022 22:53:27 +0000 (UTC) X-FDA: 79411419654.21.52EB93E Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) by imf19.hostedemail.com (Postfix) with ESMTP id 308C21A0065 for ; Fri, 29 Apr 2022 22:53:22 +0000 (UTC) Received: by mail-vs1-f54.google.com with SMTP id v139so8972979vsv.0 for ; Fri, 29 Apr 2022 15:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NCvFv9DjKSkLMaJyzSaQb9VKmwr/+2k4Wc20IRe24tY=; b=esUrF4oNfR+VdymCI1Av3lpJl5KsNz9BAuS8UyoA9vRzGabdyl9zj+cqRV7iln1piD Czq2xrH6UaVizyzzjMj/nM+vnYe6IG7krdIIPokoXN5JQJBElz3H9i/BqxJxHotz9YtW yA0CnUSEc3z2Jw0brqhydENDoajABiMvcJzaYxyUxQp+mfgzyLori9ZBHPiON5umfeCQ ib1zmu7plBmnrfpQS8CLcduVjhCRI+RuoAVhjNUWsrpV2EeydWnNM9KK83y1ZxSXEKyG PCfFv+1PTL553UF257xBWSXl98liimqiaoM9udQp7lvefYwY1Dn2UvfU7Szzjw9MQeuI 3rRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NCvFv9DjKSkLMaJyzSaQb9VKmwr/+2k4Wc20IRe24tY=; b=2XX0iianqO7OmPgcacIDCDrioSKhOXIuMZwm8UtqDd6iZ9EOGC23Z0mIEeI1Bk9ew7 C844Zr4ztakGWVgROA9Fcx8xvtNCNLGf+wm/dnPxZ/8rmKX9yMhwVpzPPCoqS5gBTlCC qc71mAk0ZA4LCqZ35U0p8/uif2DGP7Fcsivxmb1e1VhP/56R9aW/Z7RQ+pTrhb6ylF0U s2BdI58Wd4T9SHBIC72iKDpmHqRyeCl6g0DCB6ZZfPrS3xN+mc3zAY0ETKB2mpZmybXa +CwiP42JL7NyTAfpK4rl4dGEjLRGcC/tZJ7KRYVjTUOeyMPnnl5Gm5RCxscOVOGa9yxh wukw== X-Gm-Message-State: AOAM530OaVrrQza/C7BTqhhYjgRhQlnMaXq1VX2k8w/SPJGmf3jJxqbO ZUWpwQiSkG2rInB2QMW0sOqYPjpaFCdyg3ReeuP7qQ== X-Google-Smtp-Source: ABdhPJxoIYb/hGzsvf7V+e320vQK2hSlmgOz00BaAMSviQUZAHpiap0Zo/kDwpOqcUBJpKXUIcV4lwDraec3Ya55lAE= X-Received: by 2002:a67:c58c:0:b0:32c:fb57:2f76 with SMTP id h12-20020a67c58c000000b0032cfb572f76mr635196vsk.53.1651272805985; Fri, 29 Apr 2022 15:53:25 -0700 (PDT) MIME-Version: 1.0 References: <20220428161551.722296-1-erdemaktas@google.com> <6f99684f-172c-ccf2-0be3-9aca85451079@intel.com> <2bf733e7-49f3-12de-bf9d-73b23286754d@intel.com> In-Reply-To: From: Jue Wang Date: Fri, 29 Apr 2022 15:53:14 -0700 Message-ID: Subject: Re: [RFC] Expose a memory poison detector ioctl to user space. To: Dave Hansen Cc: Erdem Aktas , almasrymina@google.com, dave.hansen@linux.intel.com, gthelen@google.com, jiaqiyan@google.com, linux-mm@kvack.org, naoya.horiguchi@nec.com, seanjc@google.com, tony.luck@intel.com Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: cdowhzdbprrmoi95kmnywe3yzck9fps9 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 308C21A0065 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=esUrF4oN; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf19.hostedemail.com: domain of juew@google.com designates 209.85.217.54 as permitted sender) smtp.mailfrom=juew@google.com X-HE-Tag: 1651272801-466711 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 Fri, Apr 29, 2022 at 3:29 PM Dave Hansen wrote: > > On 4/29/22 14:32, Jue Wang wrote: > > On Fri, Apr 29, 2022 at 2:10 PM Dave Hansen wrote: > >> I wouldn't go that far. The unaccepted TDX guest memory thing is just > >> the obvious one at the moment. There are a whole ton of other guest > >> ballooning mechanisms out there and I'm not sure that all of them are > >> happy to let you touch ballooned-away memory. > > > > This type of scanning is intended to be run on the host side. That > > should avoid concerns around the guest ballooning or any effects to > > the host side reclaim that's based on the guest's working set. > > Hint: Talk is cheap. Just saying how it is intended doesn't avoid > concerns. > > Saying how it is intended, then backing up that intent with code and > deliberate design that matches that intent would be nice. > > > I don't know why a guest wants to spend its CPU cycles and pollute its > > caches etc to run this scanner, anyway. This should be a benefit > > provide by the cloud platform transparently to the guest. > > "This should only be used by and made available by cloud providers!" ... > says the cloud provider. ;) This is a much better way to put it. How to express in design that some kernel component that is "best to be used by and made available by cloud providers" is what I like to get some feedback on. :-) > > Also, who said anything about polluting the caches? Aren't there lots > of reasons for a memory poison detector to intentionally not use the > caches? First, you really *do* always want to go to memory. That's > kinda the point. If this code hits the caches, it's kinda pointless. > > Second, you want this code to have a low profile. Not polluting the > caches seems like a good way to have a low profile. > We were experimenting with some non-temporal prefetch hint (prefetchnta) that worked as intended based on perf measurement. The pollution to LLC is minimal but non-zero. This is definitely an area we want to keep iterating on, love to hear feedback. Thanks, -Jue