Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4686374pxu; Tue, 13 Oct 2020 04:57:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+cq7OzxVa+iXR6m+UYKmcbHooeMngI8vf+h9Gk5tkn9TXcYWKsHeOWvLfajReMzC898h1 X-Received: by 2002:a17:907:aa9:: with SMTP id bz9mr7748271ejc.472.1602590263235; Tue, 13 Oct 2020 04:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602590263; cv=none; d=google.com; s=arc-20160816; b=pJs3yCRCeD/EpycexdIUvW06mv/TN/30Nl/wQq1Cl9A8hWAPcNrjn60lgULhaF4b2J feJhm2H22Uf/YKtKXFYt+/FlcRXHEZC77Ekb1JgK6dSrF9QN00MeYcuq/RDi0LlsLkqI xjUULXcMaS3Rc00AD66vLUPvz6WrMjpuWjmhJJV+6MpMDp+9q8KYyey8mB7cAbQ4DiT0 xrn4C0zW1z64j0yf4p+DBwPAG30Y6seiFYAZdF31q2MmKx8XOaAUi9vU4tAS1Pd8aGTs Pe6OowtZ8eYk/Y1pze3PzQUN0ksfl4Npi6ALm39kq5bI1HUE4SXg5AoT3+Vx4OGgm3Pd eb9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=U29b+DpSNEK8t7VlArhSyxRK4Bdvo64dhfMqIFz57jI=; b=c8IDDh0REc/uoKoVsMPyguzlxCqkscozjrVbNTr5AzuqFJL7pRSkEIAVa/elaac6tG fkBccLCBfK9ZR0VraGIxcC9vs3Pdvl+5jx9l4LMLlLao5tFLzBd+Kb7f4XX4cQba/C32 RCIrt8KjH49fqiPrBptt5H50SSfLyOYsSxi81PHPw3kGORpxAF9csdJcIDz/eyZTkGbQ FxSguQQ5oT1AoBSAtXlYXpSI0Y28ytY7SDg4MZWf1AEJp/aaPeZ0KFoHTmTkn4RnTU9I hlPnCWcCCcT5nNOex0QhsAcEVj2tIm0R31wN3O4RUvaMq5fS1hNjEuIOwRyTuCWI38B9 AFLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Tikn7NUc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx26si14640974edb.557.2020.10.13.04.57.21; Tue, 13 Oct 2020 04:57:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Tikn7NUc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390061AbgJMH1U (ORCPT + 99 others); Tue, 13 Oct 2020 03:27:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:46574 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390007AbgJMH1U (ORCPT ); Tue, 13 Oct 2020 03:27:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602574038; 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=U29b+DpSNEK8t7VlArhSyxRK4Bdvo64dhfMqIFz57jI=; b=Tikn7NUcWUEWnTzMrc/bhhgLXNogzAAMQW9NynZo0eo4WaT0xGme9aVG9tg3FYD3gGIKqm ooMAxA01Ef4LRZNQh88cFO/ql8dxY84rmAIpRyJO4HzgTwqEaIu1F4k4ZiCoYJORmLKHqw Fb8OrPKYIWJtbOdULSDxGXRhrmnnyqQ= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-6-6PFseH0wPoaF48q-GEqcVA-1; Tue, 13 Oct 2020 03:27:16 -0400 X-MC-Unique: 6PFseH0wPoaF48q-GEqcVA-1 Received: by mail-wr1-f72.google.com with SMTP id r8so3145523wrp.5 for ; Tue, 13 Oct 2020 00:27:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=U29b+DpSNEK8t7VlArhSyxRK4Bdvo64dhfMqIFz57jI=; b=JUfb1EB9pgURF4Lg5uV6eHR5PFFUaUdzNVciVutrvA+ccGnEkXwkSdPXSfM+FyNfLz 8yuzX9x2Kpgk0Y1QdkElG15SxfdqbR7AMzGgRp+1Mv4gVDr/Mt0u5csNKhaqMmPZ10ok e/6+bjeNYTV/3n/IPrntsVklauYh+3/OZ8NY04kRTDrjFKl9u35jvkIgVfb6lrg9rKd0 MaPBuuMgmoIhNkZVUz8hSLuJGA/JxkSRR3++3cD6Q+/PlCSYEDMjhmGqkbqQvYAU6WRZ m1cSvOUZmsepcKyradtcieVfgnVXURcFOa1Rl6aID/jD3WbkyRNtpd6KzBUp4ySnxbEz Ftsw== X-Gm-Message-State: AOAM532zpkEp57JOUS2OFI1JrHfJRwZdkc9GJ7AgSejQnm6hCrsdByhE wN+B8p104iYMUo5xSG5j1pB1z3znVa+889UUt35MzKYVr5T1Pn5p+Xup2+qsT3C9HATARRnkYBG JfwajqqbnJfKm7r3TIGjAh/V2 X-Received: by 2002:adf:e78b:: with SMTP id n11mr35392304wrm.280.1602574035546; Tue, 13 Oct 2020 00:27:15 -0700 (PDT) X-Received: by 2002:adf:e78b:: with SMTP id n11mr35392272wrm.280.1602574035354; Tue, 13 Oct 2020 00:27:15 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:61dd:85cb:23fc:fd54? ([2001:b07:6468:f312:61dd:85cb:23fc:fd54]) by smtp.gmail.com with ESMTPSA id t124sm27268833wmg.31.2020.10.13.00.27.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Oct 2020 00:27:14 -0700 (PDT) Subject: Re: [PATCH 04/35] dmem: let pat recognize dmem To: yulei.kernel@gmail.com, akpm@linux-foundation.org, naoya.horiguchi@nec.com, viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, xiaoguangrong.eric@gmail.com, kernellwp@gmail.com, lihaiwei.kernel@gmail.com, Yulei Zhang , Xiao Guangrong References: <87e23dfbac6f4a68e61d91cddfdfe157163975c1.1602093760.git.yuleixzhang@tencent.com> From: Paolo Bonzini Message-ID: <72f4ddeb-157a-808a-2846-dd9961a9c269@redhat.com> Date: Tue, 13 Oct 2020 09:27:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <87e23dfbac6f4a68e61d91cddfdfe157163975c1.1602093760.git.yuleixzhang@tencent.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/10/20 09:53, yulei.kernel@gmail.com wrote: > From: Yulei Zhang > > x86 pat uses 'struct page' by only checking if it's system ram, > however it is not true if dmem is used, let's teach pat to > recognize this case if it is ram but it is !pfn_valid() > > We always use WB for dmem and any attempt to change this > behavior will be rejected and WARN_ON is triggered > > Signed-off-by: Xiao Guangrong > Signed-off-by: Yulei Zhang Hooks like these will make it very hard to merge this series. I like the idea of struct page-backed memory, but this is a lot of code and I wonder if it's worth adding all these complications. One can already use mem= to remove the "struct page" cost for most of the host memory, and manage the allocation of the remaining memory in userspace with /dev/mem. What is the advantage of doing this in the kernel? Paolo