Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp904050pxf; Wed, 7 Apr 2021 14:39:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvjvvFTZfGRhnbGeaIWWPUW9P1YMEgS0MOeJcdhY8Uv4Q0j8YYYILnQK0o2gSRl89WmM3w X-Received: by 2002:a17:906:33d9:: with SMTP id w25mr6442143eja.413.1617831564824; Wed, 07 Apr 2021 14:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617831564; cv=none; d=google.com; s=arc-20160816; b=Wc0ZPxB0q0U/Q00+QVfWNADj/3pH0KTyEFvTodcQJOcH+bDR8efJT6JbaCIv+VhGDt BTGv9NHgIG86w2j4DblZMzF/JGgrmx71O04tr8dw5uamxW5RGO/8cOOBQbyhDtmhutUS 7l6n8YRWPoadWZRqTH8F0VKixgzxH1PP26V+317UNg0IFrtqaWOWRUF8v84+GdVzP7js g+xv3hPtHqMxRj327JFU47SDfZUqQ6ZGRfPnwM+eOxfDYKxKCJUI4BZlTNAck9Lfc2X5 CdpY2gFBZZ9+56rb84DIwqi826PqC8bTKiD0sVGeaaw8mlmx35d/uGO7PBbKriJZUTg8 xWNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=Qka4XP86mo9tivOZXeavKjVRjtUNs3I7vqQxIv9BF4o=; b=SE8xyZD1lRwyokcAtw17Dns/2KVG+RGnfyI35lObN4LaVhaSKHqsU+FXt66Wa/wcwk Oimy/vpUxMxZR/PcTK7775Po0FA6t5TA5AdQbKm/UjPhBAOYJxkvg8KYArI1voDtp4mY ERWk3/eYcfZiPnekHW/08CfrD6HzxaXDfNt/SMwbDkgpSTRNgyzqKt8kpLd7rXZ4Hi9J vVVe7EI1YJ+cEsHOFAfDLYTc8v+6JBh7gqNJR2pCim6jMcwffU/+2EWwoFUF4tIERpUT r09c76r+bFTkVW4jWJTCA11rvKWWxU17OPmLysWZKYnWrcvZMoaQ9GHg1ZGhMC/MG+OW G+Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sKeG7jF4; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si21276497edf.499.2021.04.07.14.39.01; Wed, 07 Apr 2021 14:39:24 -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=@google.com header.s=20161025 header.b=sKeG7jF4; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354422AbhDGRAH (ORCPT + 99 others); Wed, 7 Apr 2021 13:00:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347954AbhDGRAH (ORCPT ); Wed, 7 Apr 2021 13:00:07 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 894B2C06175F for ; Wed, 7 Apr 2021 09:59:57 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id ay2so9661177plb.3 for ; Wed, 07 Apr 2021 09:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=Qka4XP86mo9tivOZXeavKjVRjtUNs3I7vqQxIv9BF4o=; b=sKeG7jF4DC6TkXssMwfoL5Yb2M1BIPx0VHweK89YLof7HVvwYTDocHqwKP9iyPbezs eBMc5Fx/A7j66s9Pr/5DHJYgatXOlXejrVfzhzwyPWOfpEH/2OhT3qyGDFRCVxiVW5cH jj49DGK2wrNlvBo44yjLpWvx3KfAQktiCjCPQ54YSK0ylxusD7IiO/AmCxv9jx4Ak6Of g5U5BoNKlaCYQ2dMW3D2isrgvjyEw70ZJwI+I37gxZJMTvnyRRoUnWyUfbkdCitbiH/8 R675Wd6nzsuPnsOR6DGaLMsmk3g2Nx/MQvR0+IH6P6a1YlP2TLdodzEWCrOVjV7mTr+L ORRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=Qka4XP86mo9tivOZXeavKjVRjtUNs3I7vqQxIv9BF4o=; b=Y/wTFdbmxIrgSCKYQsUUKKVS3MpszOYsdpk4eK+YjDGSoyFa5mPSRUyb575Ghn5y3D tFYuZzxAYKmJNvVv1JfOmY0V+Zb8En2FqAkDVDLv4On7qI21hwK64O+UW12N8N1cits8 0/MPAuV3vf/fHUgTswYES/1o+jGXD6OPwB0TPiY8TL0w06msu9Ntgkc2XYBmugK+O9ZR cg9wQtOaa9xjiNmNvmdDiqC0//fUj7oRnIyVpZJGMs60jzkeOoVRXUJWbjuvlV2OX3l1 50FN1I0LaKuRLKFX87NhjdoBOfHuejwaZLZgP5o5ViMpE9cwpA2Cq3fpqAt9lkA8sAz9 8NhA== X-Gm-Message-State: AOAM532bTtPS6A8iYwujXGNO+6GyTSLJu2ruupPgYBTdTXSBTEsUfcEf P19kPlqW662T8S4QI9i3/1K2pw== X-Received: by 2002:a17:90a:7064:: with SMTP id f91mr4337107pjk.89.1617814796875; Wed, 07 Apr 2021 09:59:56 -0700 (PDT) Received: from [2620:15c:17:3:c4a4:628a:2d06:e140] ([2620:15c:17:3:c4a4:628a:2d06:e140]) by smtp.gmail.com with ESMTPSA id u1sm21982451pgg.11.2021.04.07.09.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 09:59:56 -0700 (PDT) Date: Wed, 7 Apr 2021 09:59:55 -0700 (PDT) From: David Rientjes To: Sean Christopherson cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: Re: [PATCH v2] KVM: Explicitly use GFP_KERNEL_ACCOUNT for 'struct kvm_vcpu' allocations In-Reply-To: <20210406190740.4055679-1-seanjc@google.com> Message-ID: References: <20210406190740.4055679-1-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 6 Apr 2021, Sean Christopherson wrote: > Use GFP_KERNEL_ACCOUNT when allocating vCPUs to make it more obvious that > that the allocations are accounted, to make it easier to audit KVM's > allocations in the future, and to be consistent with other cache usage in > KVM. > > When using SLAB/SLUB, this is a nop as the cache itself is created with > SLAB_ACCOUNT. > > When using SLOB, there are caveats within caveats. SLOB doesn't honor > SLAB_ACCOUNT, so passing GFP_KERNEL_ACCOUNT will result in vCPU > allocations now being accounted. But, even that depends on internal > SLOB details as SLOB will only go to the page allocator when its cache is > depleted. That just happens to be extremely likely for vCPUs because the > size of kvm_vcpu is larger than the a page for almost all combinations of > architecture and page size. Whether or not the SLOB behavior is by > design is unknown; it's just as likely that no SLOB users care about > accounding and so no one has bothered to implemented support in SLOB. > Regardless, accounting vCPU allocations will not break SLOB+KVM+cgroup > users, if any exist. > > Cc: Wanpeng Li > Signed-off-by: Sean Christopherson Always happy to see this ambiguity (SLAB_ACCOUNT vs GFP_KERNEL_ACCOUNT) resolved for slab allocations. Acked-by: David Rientjes