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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 608FEC432C0 for ; Tue, 26 Nov 2019 15:21:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FECF20722 for ; Tue, 26 Nov 2019 15:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728457AbfKZPVN (ORCPT ); Tue, 26 Nov 2019 10:21:13 -0500 Received: from 8bytes.org ([81.169.241.247]:52956 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727770AbfKZPVN (ORCPT ); Tue, 26 Nov 2019 10:21:13 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 768AD18E; Tue, 26 Nov 2019 16:21:11 +0100 (CET) Date: Tue, 26 Nov 2019 16:21:09 +0100 From: Joerg Roedel To: Paolo Bonzini Cc: "Kirill A. Shutemov" , Vlastimil Babka , Andrea Arcangeli , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org Subject: THP refcounting in disallowed_hugepage_adjust()? Message-ID: <20191126152109.GA23850@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Paolo et al, while looking again at the recently added IFU patches I noticed a dicrepancy between the two _hugepage_adjust() functions which doesn't make sense to me yet: * transparent_hugepage_adjust(), when changing the value of pfn, does a kvm_release_pfn_clean() on the old value and a kvm_get_pfn() on the new value to make sure the code holds the reference to the correct pfn. * disallowed_hugepage_adjust() also changes the value of the pfn to map, kinda reverses what transparent_hugepage_adjust() did before. But that function does not care about the pfn refcounting. I was wondering what the reason for that might be, is it just not necessary in disallowed_hugepage_adjust() or is that an oversight? Regards, Joerg