Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp889082ybl; Fri, 13 Dec 2019 06:14:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwQTr/EtzaVnEIudZx8HoTlLyJTYrNZIehv56Al5p5Lxvm2OL0CzTN7zZh9FoFX6jSOBtfI X-Received: by 2002:a9d:6285:: with SMTP id x5mr15279381otk.144.1576246447704; Fri, 13 Dec 2019 06:14:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576246447; cv=none; d=google.com; s=arc-20160816; b=ZG902hefa0j0v5X/ktjaBn3mQCBQch2dFzAWJY2tEUYUZVqXYSOELDYMkaPvAskd5e aMG9c73FppXji95jpjqJJLw3ZGwm+il46wvz3IOWnP77gRIWtOal/XgB2L+5EvTuLWlQ vAvd/obAK9+ly328Dcvvj+6K9nMwSApMUKu4hCtkhxLIEs0udqUHZMf+rGsX+TfRgwHH Ul73u3hDOBuEvhygKMNHzSDJ1buOR/7LUNGhJwTqQ7RhXqi4oImopjH1w0J7ZWf5ZWGk o+Z8AlEqgJ9CIybTbxR5mjeGekxJizlcsEaxQk05Kz8cheMHfZRN5h1eagjj9mjQ8UIm D0mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Nid8tA47CgGN/j7YlqJfGqUykgFGi6RHG/gnONQyj4E=; b=Rhyjz6ItL2PCeTTIJ6qUFrV89nVrI1KIwyiYFlAzXRaO3UG6xy5g41LYEa5Wek7gy9 NJ/EeBage6eT6RQGPjLD0NMP/JXP5J2DMNj6ZILv0fgbo0Jvfh1NbboQU0d3Mu3/PzIt 2M55YQ+nYu9eGYLsF3fo0IQW+LBN8opAE/6c18T0jSb+kn4idM0VbSwpVgOOvqH1MjbZ f/PneAcS/BbLb3T5tbvPddYBkNDx3IIaEjxpcihhLGUt5Kp65FCiMXnukZsfvpEHVGC/ D7Sv5YkddP5rkMuIFC1WxVNkoXpn5uwIQ0Bzgfp/WOWwpSwzeYibiuHI5Iq/XyDf8n/l JsEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iiL3Udja; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8si5076485oto.36.2019.12.13.06.13.55; Fri, 13 Dec 2019 06:14:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iiL3Udja; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727700AbfLMONK (ORCPT + 99 others); Fri, 13 Dec 2019 09:13:10 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:35950 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727563AbfLMONJ (ORCPT ); Fri, 13 Dec 2019 09:13:09 -0500 Received: by mail-qk1-f194.google.com with SMTP id a203so2143351qkc.3 for ; Fri, 13 Dec 2019 06:13:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Nid8tA47CgGN/j7YlqJfGqUykgFGi6RHG/gnONQyj4E=; b=iiL3UdjaR/ciA0kSMNs852p8OTlOiquuE5fH159L/f/kyYZSKGWMWVam+pUVGCkXzn 9bgt3SEbd3pKnEhCeny9C42+mC0KXfiMLBQgpimffHI86crwzaVM/11h7Y8coEKA38o+ tCVCdPV56qNiZgx3KgERpcRrNrVWUEs+0alaL5KGOlujfPecyMF86opv0mn3yFtlMhi/ HSFudy4nXLFhq55ZzOCCgbDw0syt6JyzB7F1//hQ+zzHl5IqhR2XQhaFKSX6W7QnskC+ 6wTsaWtttmI+TDa2Sz4IrzVt+oKSBMj5Bnc1BiFbug2PEg9RfDO5OiVAlqxNQb7ozfcK /Ebg== 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=Nid8tA47CgGN/j7YlqJfGqUykgFGi6RHG/gnONQyj4E=; b=oEu98J0q5cjO9FVDcnlYzPAoimuiozMDvT5Bp5hPKLD2cpK1L7M9dts09yMjOOlmEH yZIw4iI4G5PN/fK6pnb7P6vccBufXBxTLJ3sznGqaR7Xl79EVx+LmuBOo3nFMeCPH3lI lk+QJ+0JmU/tt4egqUTOKNH09wX+PSMtb7vpVIKaYSbIz99kJY5RvonpsvnKpUXqqufq ZS6mLyj1UQSFzEmOJrw+KSoGXjX2KSmeqJUna/1kDyCIovBCQkPV61xIN/eTmU+D5diE HaF8HfDnhuSXDkhDU3zfbhEaq9z0ERQcIV/RiSL8ZqUmYQ7gs+FTW6Qo47jecfu8Dpo+ BQ4g== X-Gm-Message-State: APjAAAUuK44QXuJv9qv0P2bGn9Tkkd3V2ktPQzTieo9aOaUUFMoxadMe TgWLfeMwBUHHL7Ml0tUPC/phGw== X-Received: by 2002:a05:620a:12ae:: with SMTP id x14mr14203983qki.5.1576246387524; Fri, 13 Dec 2019 06:13:07 -0800 (PST) Received: from [192.168.1.10] (c-66-30-119-151.hsd1.ma.comcast.net. [66.30.119.151]) by smtp.gmail.com with ESMTPSA id z28sm3463658qtz.69.2019.12.13.06.13.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Dec 2019 06:13:06 -0800 (PST) Subject: Re: [PATCH v5 2/2] kvm: Use huge pages for DAX-backed files To: Liran Alon Cc: Paolo Bonzini , Dan Williams , David Hildenbrand , Dave Jiang , Alexander Duyck , Sean Christopherson , linux-nvdimm@lists.01.org, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, jason.zeng@intel.com References: <20191212182238.46535-1-brho@google.com> <20191212182238.46535-3-brho@google.com> <06108004-1720-41EB-BCAB-BFA8FEBF4772@oracle.com> <65FB6CC1-3AD2-4D6F-9481-500BD7037203@oracle.com> From: Barret Rhoden Message-ID: <90a9af31-304c-e8d5-b17c-0ddb4c98fddb@google.com> Date: Fri, 13 Dec 2019 09:13:05 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <65FB6CC1-3AD2-4D6F-9481-500BD7037203@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/12/19 8:07 PM, Liran Alon wrote: >> I was a little hesitant to change the this to handle 1 GB pages with this patchset at first. I didn't want to break the non-DAX case stuff by doing so. > > Why would it affect non-DAX case? > Your patch should just make hugepage_adjust() to parse page-tables only in case is_zone_device_page(). Otherwise, page tables shouldn’t be parsed. > i.e. THP merged pages should still be detected by PageTransCompoundMap(). That's what I already do. But if I wanted to make the hugepage_adjust() function also handle the change to 1 GB, then that code would apply to THP too. I didn't want to do that without knowing the implications for THP. >> Specifically, can a THP page be 1 GB, and if so, how can you tell? If you can't tell easily, I could walk the page table for all cases, instead of just zone_device(). > > I prefer to walk page-tables only for is_zone_device_page(). Is there another way to tell if a THP page is 1 GB? Anyway, this is the sort of stuff I didn't want to mess around with. hugepage_adjust() seemed like a reasonable place to get a huge (2MB) page table entry out of a DAX mapping. I didn't want to proliferate another special case for upgrading to a larger PTE size (i.e. how hugetlbfs and THP have separate mechanisms), so I hopped on to the "can we do a 2MB mapping even though host_mapping_level() didn't say so" case - which is my interpretation of what huge_adjust() is for. Barret