From patchwork Fri Oct 26 07:58:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Orr X-Patchwork-Id: 10657045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5BB4D14BD for ; Fri, 26 Oct 2018 07:59:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 515922BD78 for ; Fri, 26 Oct 2018 07:59:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 455DF2BDB9; Fri, 26 Oct 2018 07:59:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E44B92BD78 for ; Fri, 26 Oct 2018 07:59:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC10D6B02D3; Fri, 26 Oct 2018 03:59:07 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B703D6B02D4; Fri, 26 Oct 2018 03:59:07 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A87646B02D5; Fri, 26 Oct 2018 03:59:07 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by kanga.kvack.org (Postfix) with ESMTP id 69B7B6B02D3 for ; Fri, 26 Oct 2018 03:59:07 -0400 (EDT) Received: by mail-pf1-f199.google.com with SMTP id v88-v6so163637pfk.19 for ; Fri, 26 Oct 2018 00:59:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:date:message-id:mime-version :subject:from:to:cc; bh=AnJMoxuUxZM6HqRS0fM8ewLg4Xc9cP8Nti77j3KG1aM=; b=M/FnPZIdXXGFOQIRWjbT8jr/X6j+FaTnfenXohAwWGGjScRFXO2YQuKLRMzH+Faylu D0cDto7Ukfn5ggSpJLejXaRC/N4RjTp4X0MPcrGQgwY0mupuODiN+MVRzu2zXGk1jZSN 1ygbBAr8Q7d0h5WuKn7t/dJZArLd3X+wtX10Md8cEbhUlgGsnqR0F1VNadsMlJoy9XkD FkB+brCOwfoCXhBvHf7n38D/SOmjTtmYJmxQXiGSpYwiLWH6r1K+xefyhnVqrkZA339G avoy0d2vRA3QSYtVGRJ17ZFZgX9r//jeA0bfDVfcLqbaBeL/yLpB0EgwnGk+bjcjashn 8QFQ== X-Gm-Message-State: AGRZ1gIUV8ytner+X3NCevrF85WonrrZYtBVVSUr372wusSM+Sm4/dLF w1A4avRRIV9nIkOk+IrN0QO6ho7ndLKQBWz3CYEDEgMgbe41NY2S2/aR5Ph5u5A+Yjb1igxd/w/ wTUrtVtDnnTxTG5CV1EaN6+LqUlWTIluYC/s8zH6kZteTebS9/3TLhi60HJa6CLi8tzM3orSaFO SA1xGQLYhIL7Ksgo9D9M1e7gdNht75APlD/WC6n2gQ26DnUouDVms3WdEyrtgEyOqkJ7IoV5ue0 95pxzCSi1OIG+mrI1T0/3/iuDNhSRZ2NImNJs71NrDBrLUjys6eOne9ZdMXO3KrJ8GAkPRL+xgt HAVjt0hvUPyOCSHBpiremoAPl5Nt3VPX8lLTm5ADwb67hnd4wGPVt1DK2R1hueoA5DouY1EetP8 4 X-Received: by 2002:a17:902:22a:: with SMTP id 39-v6mr2514705plc.267.1540540747019; Fri, 26 Oct 2018 00:59:07 -0700 (PDT) X-Received: by 2002:a17:902:22a:: with SMTP id 39-v6mr2514684plc.267.1540540746284; Fri, 26 Oct 2018 00:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540540746; cv=none; d=google.com; s=arc-20160816; b=Ww4ZPXwrPA6HVJ5OXugoqg/fPZOxy9LBuMlHN60GlKbckA4wqfqFR+SEe+N/RqDdOD R8n6Rvx1yKcGqBlRn0udNGjgkqgUY/xeT9nqN5/P8Rv6NmIwvFg6VVcDuaruwZo71qdC AH3tH1Z9RSmTP7N6ejYbAyPHk+aMho+pyvlDvCQPHKmUdL4oYK2PfO3taJ3vQNzpOIHM aGgRKTFogbNJRKrfpBHPmBLSdGLm6jGERAcGe6TYlZTfDkrKx892nhuntP/j5+hChypq J+d/zPKyNd0DZyqzv337CN5sHNj+Bj4qov2uu5veYul1msQ5O+jCOTTizBelAXPjTLZ8 LEzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:mime-version:message-id:date:dkim-signature; bh=AnJMoxuUxZM6HqRS0fM8ewLg4Xc9cP8Nti77j3KG1aM=; b=KTSUqhrJTa35vAtE4kgHoadnbrvZR/Is3kwfH981czFRygJ/IcK2AvsZjZKidxmdGz lwvic+qTlHF9lhgUmnkVcwIC7n3XZEEyERzBVPmowMoXi4NxsQrUxPJ1dg0/Chr4lsCs wFUPMZbhBVsk1IO2kxOZh7/Or+suAnkiOQgO/yp3qi0NHNDU6oUM8xQIUovTAgEOImXC ZoJtIVmLnSEFbfbi6A4Y30JR4KV2bosiEdnGJRrMC93rALVHn+riPeBT95LJaMAFaM/Q lUFApmXfOIafQOpqsFvI7pjzoNVrVQO+xPLIKJwowuRD8fFrnuvjoNSvc53YMGvpA9Wq UmwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fh3j8OaS; spf=pass (google.com: domain of 3scnswwckcawym3o033s00sxq.o0yxuz69-yyw7mow.03s@flex--marcorr.bounces.google.com designates 209.85.220.73 as permitted sender) smtp.mailfrom=3ScnSWwcKCAwym3o033s00sxq.o0yxuz69-yyw7mow.03s@flex--marcorr.bounces.google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f73.google.com (mail-sor-f73.google.com. [209.85.220.73]) by mx.google.com with SMTPS id k128-v6sor6794697pfc.4.2018.10.26.00.59.06 for (Google Transport Security); Fri, 26 Oct 2018 00:59:06 -0700 (PDT) Received-SPF: pass (google.com: domain of 3scnswwckcawym3o033s00sxq.o0yxuz69-yyw7mow.03s@flex--marcorr.bounces.google.com designates 209.85.220.73 as permitted sender) client-ip=209.85.220.73; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fh3j8OaS; spf=pass (google.com: domain of 3scnswwckcawym3o033s00sxq.o0yxuz69-yyw7mow.03s@flex--marcorr.bounces.google.com designates 209.85.220.73 as permitted sender) smtp.mailfrom=3ScnSWwcKCAwym3o033s00sxq.o0yxuz69-yyw7mow.03s@flex--marcorr.bounces.google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=AnJMoxuUxZM6HqRS0fM8ewLg4Xc9cP8Nti77j3KG1aM=; b=fh3j8OaSdLIRyODaPbk+fl+nxqNDrMpcTIhd6HoymcyjPxqoXkI3w2FEZk+9MaNkMq OPvkj6upM42BBws42WR8qPcGf9Qk3mcnqxOodj9dBw38Yuiu/VKwBaSLjOAWvWuimQiS Y3D48W641AMX9zKTcXeIf7vAwc2gR7Sa4FA6HfeWpYf6cP6QmXSNGl1I/n0Qc1GtBcc4 J8V8jnEw7y6CFd73e6JlmkfKGmXq+zJVrfHEbvsaUJGgf6CNDt+JMHhPjRRhgqWo44wF GRcQnsN3MYnktY9IG3SrAz15i0QHGhs/qeIklcwCnQW7KL8NRuVGmqT9pxmFIrvBnHiI G5gQ== X-Google-Smtp-Source: AJdET5dqWOLphOOvFvWcjnIDvjNUIfwSq6SA4SMo+mk89i2DHeW2iDSPvpscoBrw6ujJdqTFRPsVM55wjjf/ X-Received: by 2002:a62:4853:: with SMTP id v80-v6mr1287973pfa.10.1540540745847; Fri, 26 Oct 2018 00:59:05 -0700 (PDT) Date: Fri, 26 Oct 2018 00:58:58 -0700 Message-Id: <20181026075900.111462-1-marcorr@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.19.1.568.g152ad8e336-goog Subject: [kvm PATCH v4 0/2] use vmalloc to allocate vmx vcpus From: Marc Orr To: kvm@vger.kernel.org, jmattson@google.com, rientjes@google.com, konrad.wilk@oracle.com, linux-mm@kvack.org, akpm@linux-foundation.org, pbonzini@redhat.com, rkrcmar@redhat.com, willy@infradead.org, sean.j.christopherson@intel.com Cc: Marc Orr X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP A couple of patches to allocate vmx vcpus with vmalloc instead of kalloc, which enables vcpu allocation to succeeed when contiguous physical memory is sparse. Compared to the last version of these patches, this version: 1. Splits out the refactoring of the vmx_msrs struct into it's own patch, as suggested by Sean Christopherson . 2. Leverages the __vmalloc() API rather than introducing a new vzalloc() API, as suggested by Michal Hocko . Marc Orr (2): kvm: vmx: refactor vmx_msrs struct for vmalloc kvm: vmx: use vmalloc() to allocate vcpus arch/x86/kvm/vmx.c | 92 +++++++++++++++++++++++++++++++++++++++++---- virt/kvm/kvm_main.c | 28 ++++++++------ 2 files changed, 100 insertions(+), 20 deletions(-)