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=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 8D043C00A89 for ; Mon, 2 Nov 2020 19:46:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E48AC20731 for ; Mon, 2 Nov 2020 19:46:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="SaEFxDNL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E48AC20731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 744566B0068; Mon, 2 Nov 2020 14:46:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 71AF96B006C; Mon, 2 Nov 2020 14:46:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60AFB6B006E; Mon, 2 Nov 2020 14:46:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 353726B0068 for ; Mon, 2 Nov 2020 14:46:10 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C4122181AC9CC for ; Mon, 2 Nov 2020 19:46:09 +0000 (UTC) X-FDA: 77440509258.28.end90_5b01fb2272b2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 8AAB26C3C for ; Mon, 2 Nov 2020 19:46:09 +0000 (UTC) X-HE-Tag: end90_5b01fb2272b2 X-Filterd-Recvd-Size: 5655 Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Mon, 2 Nov 2020 19:46:08 +0000 (UTC) Received: by mail-ej1-f66.google.com with SMTP id s25so6587852ejy.6 for ; Mon, 02 Nov 2020 11:46:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9S7vWYZqXm3PqYUWfzNRmMs/AaRtdM//LcdO3k++WwE=; b=SaEFxDNLdalp+GldG72yakmXkFbPbvhYxzUPN6V+nHaJHQC2qvu41yf5eyB/QcvIXx fnyL4DvxD35TO/GGvlfiXuDMtgtT477/tYOW13bVtx/OrLfSQ2t415bP2SHkjLL/O8mJ AcwcCG+YwCDYOmn97Av9Te4pGZgyijcm5ClJbwvmjt3zc5RTZiF91Bs2s0gL3oQB2GB+ ARpsn11XbZVHljA+/UnLfDpb8EBTXxpHgcXRJNr3gf+joX3g5/xDr/C7sjj+V5qYdXj/ wgzPh+YKW1OvL3e4zUCCLAolj2fD2CNU9Ha6NeCI7xlO0U/CzEs2YoC5HjL0OOqx8G4u IByQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9S7vWYZqXm3PqYUWfzNRmMs/AaRtdM//LcdO3k++WwE=; b=X7tbDnfoaC77+AtgC+hjFtmwK8gwt4WRm2vLgKePNB/tRyEPjjVEmIRMCPGKZ9Th/A Kgv7PGZrizrlTs/UVv4sPuN/y0jEBdCD45GZ8h7bOvGXqeBnMezXRMjUCtwarfhz96qy miFjBbHuMIBT0v5DUg5PS4ga9VjOEW4r6zTwQusSdEHV4+3N4gEjClMfomBk9ckJnY0W hUuh1Rrge6MBwqpTLaO/EtNpcUbbh8nCgsA64HlzoZO/GIz4xqhtM3SSq68yWWf2IJ1T 48eqU2KF1o7LaPTMIyb04aHsOhjX1BU5AHhyjjApIc2iSi561TeAxj47FZM5ZLnsS0mX hBrA== X-Gm-Message-State: AOAM532Co84ZLeY86210w09KUjhU0lQI7Hf7LuVMYNBVi3ROcFw7bsnW LlrPU1gfCc0UHkPX4854DtPy1EBc1n25sPXviEzTmw== X-Google-Smtp-Source: ABdhPJxlB0VuTyd5PdBaybjL8K53mwvkGZB+YeHljHV/lmgT9JUksEsp6iUPlVknSl5PRxkdzwTfMN+/Mocq2Slc5vA= X-Received: by 2002:a17:906:c20f:: with SMTP id d15mr16418068ejz.341.1604346367393; Mon, 02 Nov 2020 11:46:07 -0800 (PST) MIME-Version: 1.0 References: <451b2571-c3e8-97d8-bfd0-f8054a1b75c5@redhat.com> <958912b2-1436-378f-43d7-cbc5c8955ffd@redhat.com> <2f9fa312-e080-d995-eb82-1ac9e6128a33@redhat.com> In-Reply-To: From: Dan Williams Date: Mon, 2 Nov 2020 11:45:55 -0800 Message-ID: Subject: Re: Onlining CXL Type2 device coherent memory To: Vikram Sethi Cc: David Hildenbrand , "linux-cxl@vger.kernel.org" , "Natu, Mahesh" , "Rudoff, Andy" , Jeff Smith , Mark Hairgrove , "jglisse@redhat.com" , Linux MM , Linux ACPI , Anshuman Khandual , "alex.williamson@redhat.com" , Samer El-Haj-Mahmoud , Shanker Donthineni , Joao Martins Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000632, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Nov 2, 2020 at 11:25 AM Vikram Sethi wrote: [..] > > > At least for passing through memory to VMs (via KVM), you don't actually > > > need struct pages / memory exposed to the buddy via > > > add_memory_driver_managed(). Actually, doing that sounds like the wrong > > > approach. > > > > > > E.g., you would "allocate" the memory via devdax/dax_hmat and directly > > > map the resulting device into guest address space. At least that's what > > > some people are doing with > > How does memory_failure forwarding to guest work in that case? > IIUC it doesn't without a struct page in the host. > For normal memory, when VM consumes poison, host kernel signals > Userspace with SIGBUS and si-code that says Action Required, which > QEMU injects to the guest. > IBM had done something like you suggest with coherent GPU memory and IIUC > memory_failure forwarding to guest VM does not work there. > > kernel https://lkml.org/lkml/2018/12/20/103 > QEMU: https://patchwork.kernel.org/patch/10831455/ > I would think we *do want* memory errors to be sent to a VM. > > > > ...and Joao is working to see if the host kernel can skip allocating > > 'struct page' or do it on demand if the guest ever requests host > > kernel services on its memory. Typically it does not so host 'struct > > page' space for devdax memory ranges goes wasted. > Is memory_failure forwarded to and handled by guest? This dovetails with one of the DAX enabling backlog items to remove dependencies on page->mapping and page->index for the memory-failure path because that also gets in the way of reflink. For devdax it's easy to drop the page->mapping dependency. For fsdax we still need something to redirect the lookup into the proper filesystem code. Certainly memory-failure support will not regress, it just means we're stuck with 'struct page' in this path in the meantime.