From patchwork Tue Jul 2 14:15:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pengfei Li X-Patchwork-Id: 11027917 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 A92B013A4 for ; Tue, 2 Jul 2019 14:16:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FC8B28866 for ; Tue, 2 Jul 2019 14:16:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83B0A28891; Tue, 2 Jul 2019 14:16:13 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 1651A28866 for ; Tue, 2 Jul 2019 14:16:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31BBC8E0003; Tue, 2 Jul 2019 10:16:12 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2CACC8E0001; Tue, 2 Jul 2019 10:16:12 -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 1BA268E0003; Tue, 2 Jul 2019 10:16:12 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by kanga.kvack.org (Postfix) with ESMTP id D8F768E0001 for ; Tue, 2 Jul 2019 10:16:11 -0400 (EDT) Received: by mail-pl1-f197.google.com with SMTP id 65so419830plf.16 for ; Tue, 02 Jul 2019 07:16:11 -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:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=pe03FkrBdknzSMi1BJ7D2IonOmPOSw8u72ZV3zS67vk=; b=a/XTJ5Cr/UHD74QRk9nb6h2rPZTk9gzRkTSYj5R//yPmCmfKlkSJq7xDkwjTHiMAsL IFsy9OhDI3k9T4fOUl2jKjcw8CRJCerpmT6+Ni0vx9ERXAwj2/IY0xTEmG7ygYiD+fFz F7ppmIvsC9+J3EQfXcW4059AhLqhGK+2R8COufqstMcNbY/QG4KSMxhkoALK1i9TZW0I B2QGflgZcH0c+fTv/EYg5n8zDjyOW4b7Exps3JSM24p933ZL9Fk6Xwo2T116wcTFMPJA sCrYF/UZEcsgooPqKy3Fu0yOtuVGkflZBmifcDyo8S+HD3Y/3Vu+ulwjqGes5mcCal+7 8I+Q== X-Gm-Message-State: APjAAAVNsM7PDuhta4YEr8A5/Bv6eK18XfeD0tZOa7oE87AWK/fpJMS2 NcLEd68k9F8YwBOH9hrXkc62p6rTAr8+xKP8cizrgjK+Ona9ZKrh5DQwWyJMGQcQ19hux+v1m78 MYpu0MRsPdtJD6NUU/8W2jaDECkb9pomFYfbn/vl2ck0AhE/CwhEd0kjMpetR3JIb1g== X-Received: by 2002:a17:90a:cb8e:: with SMTP id a14mr5826267pju.124.1562076971471; Tue, 02 Jul 2019 07:16:11 -0700 (PDT) X-Received: by 2002:a17:90a:cb8e:: with SMTP id a14mr5826196pju.124.1562076970489; Tue, 02 Jul 2019 07:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562076970; cv=none; d=google.com; s=arc-20160816; b=rIp+wfdpfwUQLZrTH9NSEEZ99lAfkWVZg95UoJxRI5CRr57Kd6wJOjOs9EuquMaBDA yhhiR+UbBmz25HaVksE9xi5OWQRzm49HVs3seDd+wg+/fj7l35QLTHsFZDl1RHiFTCm1 jjRwmzm+dA+HnsKp+VbmMwq74VITtEZJ4LOKskX7JRpYtrt2x5UbHSTvlgSbwYE1mCfx I4d8HafXF/HHaGPZPjqxWZ3AnRvy+hVOgt2YUdpggf6/1aoP83ASOdql1PCiuixRvftv fCdaD7wyawEPUr3W+GhtZ4k/ab1+en22lL2FRtIoEgskqDQPM/yK6pS24eCHX4CH96Gp oRng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pe03FkrBdknzSMi1BJ7D2IonOmPOSw8u72ZV3zS67vk=; b=0r+XJ7xC5BrF1byghCXG0afgFIubjKMo7RgbucUJ3/aB3+L2ZpyBjk+zaGVIJMBRvM ZFIPzOQXSG0FyUVxPzB4X9ryDZY6Cjro5or0Xyv7/6Ki7xtwG132C7dRZHvh1ufll8ZA ARc8k12Lr1DiuNgb58zZGnTyTy2izpFeGLaXx7nzhxvDe9blMgJLTnbgRxUBnKzgl2FX 4ZfblDmbuPKlLsCo+mbSxldntmJaXWHAuopzjOY6bxnhl1EN0NVr+ZTozL+NsodwTUyp vV/ZL4w27p94N/PrR5Ft7/Mn0yZYI7A4WKsvcOzjN0GvXmOQK/HhqVGDulKm5LIhwJ+G eCMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eNuV5VsK; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p1sor3584362pjr.9.2019.07.02.07.16.10 for (Google Transport Security); Tue, 02 Jul 2019 07:16:10 -0700 (PDT) Received-SPF: pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eNuV5VsK; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pe03FkrBdknzSMi1BJ7D2IonOmPOSw8u72ZV3zS67vk=; b=eNuV5VsKp26iw7pwVfUIm1yfBRF9GHZ5iFOPBMFaDQ4eYUSRy++UTay4any9hC7vdh SSVIqNhNHw4B03hBw4j0JQaWM1FgGlmuRAz+znOP0rd84XUIQ6tRtygbxpb+JJBD4/FH l0rZrhFQSbJ6PGupyvKMf23IQbAfdAPNtPT86S4ml62Yrgd5mJ9bpXL6t7YjBkGyBDvF ZMxiMqYpXwh2Ix//4h1Vkr+IhFtLPV6mkB2TJBV5pvHXceZ9tI/90Au9vearEDLJpZVe BxoAYQEs0EWsZhQO6tfSSoVnddp6//tb/3NWQqbXnNQM20d0JI7yXkZ3M2rEKI4psBdc UTHg== X-Google-Smtp-Source: APXvYqylYHf/76rs6f7Ml1h5aXwpQU2cxl0zb9G0+PnLAQbVqadmSiRJ+Ne2h/tr9v/4I48k2MLv5g== X-Received: by 2002:a17:90a:23a4:: with SMTP id g33mr6033264pje.115.1562076970268; Tue, 02 Jul 2019 07:16:10 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:648:b8c3:8577:bf2f:2]) by smtp.gmail.com with ESMTPSA id a5sm744617pjv.21.2019.07.02.07.16.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 07:16:09 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org, peterz@infradead.org, urezki@gmail.com Cc: rpenyaev@suse.de, mhocko@suse.com, guro@fb.com, aryabinin@virtuozzo.com, rppt@linux.ibm.com, mingo@kernel.org, rick.p.edgecombe@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pengfei Li Subject: [PATCH v2 1/5] mm/vmalloc.c: Introduce a wrapper function of insert_vmap_area() Date: Tue, 2 Jul 2019 22:15:37 +0800 Message-Id: <20190702141541.12635-2-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190702141541.12635-1-lpf.vector@gmail.com> References: <20190702141541.12635-1-lpf.vector@gmail.com> MIME-Version: 1.0 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 The red-black tree whose root is vmap_area_root is called the *BUSY* tree. Since function insert_vmap_area() is only used to add vmap area to the *BUSY* tree, so add wrapper functions insert_va_to_busy_tree for readability. Besides, rename insert_vmap_area to __insert_vmap_area to indicate that it should not be called directly. Signed-off-by: Pengfei Li --- mm/vmalloc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 0f76cca32a1c..0a46be76c63b 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -641,7 +641,7 @@ augment_tree_propagate_from(struct vmap_area *va) } static void -insert_vmap_area(struct vmap_area *va, +__insert_vmap_area(struct vmap_area *va, struct rb_root *root, struct list_head *head) { struct rb_node **link; @@ -651,6 +651,12 @@ insert_vmap_area(struct vmap_area *va, link_va(va, root, parent, link, head); } +static __always_inline void +insert_va_to_busy_tree(struct vmap_area *va) +{ + __insert_vmap_area(va, &vmap_area_root, &vmap_area_list); +} + static void insert_vmap_area_augment(struct vmap_area *va, struct rb_node *from, struct rb_root *root, @@ -1070,7 +1076,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, va->va_start = addr; va->va_end = addr + size; va->flags = 0; - insert_vmap_area(va, &vmap_area_root, &vmap_area_list); + insert_va_to_busy_tree(va); spin_unlock(&vmap_area_lock); @@ -1871,7 +1877,7 @@ void __init vmalloc_init(void) va->va_start = (unsigned long)tmp->addr; va->va_end = va->va_start + tmp->size; va->vm = tmp; - insert_vmap_area(va, &vmap_area_root, &vmap_area_list); + insert_va_to_busy_tree(va); } /* @@ -3281,7 +3287,7 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, va->va_start = start; va->va_end = start + size; - insert_vmap_area(va, &vmap_area_root, &vmap_area_list); + insert_va_to_busy_tree(va); } spin_unlock(&vmap_area_lock); From patchwork Tue Jul 2 14:15:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pengfei Li X-Patchwork-Id: 11027919 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 C058813A4 for ; Tue, 2 Jul 2019 14:16:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6CE428866 for ; Tue, 2 Jul 2019 14:16:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 998D728894; Tue, 2 Jul 2019 14:16:22 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 2E14A28866 for ; Tue, 2 Jul 2019 14:16:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47AEA8E0005; Tue, 2 Jul 2019 10:16:21 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 42A978E0001; Tue, 2 Jul 2019 10:16:21 -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 31A278E0005; Tue, 2 Jul 2019 10:16:21 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by kanga.kvack.org (Postfix) with ESMTP id F06068E0001 for ; Tue, 2 Jul 2019 10:16:20 -0400 (EDT) Received: by mail-pg1-f200.google.com with SMTP id u4so5993556pgb.20 for ; Tue, 02 Jul 2019 07:16:20 -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:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=WBzXR4TZZHkqkMNv1E0xRf3mfUwoTzVNVZHPzzbj8rI=; b=HUUWY+W84TNnOuCv2ChGZTaKhC6Y4BKNlYQrrn98p7r+VqVEWSNeuvpJsQJQwQkMM8 nWu0rlcN125i9EbSsYkwiKFh2xtGoKoLYWNbtgxab33PVG/h2RaJn4Uy15wXDsHMKkS/ arURUE/oB60S844Ovr8cTdGiERtJ9+mV8VF2TbfNajDo8rZKJV4LqwekGU4REOWI9+Y7 4XGOsROV8UkPoqPPNhM3FP8Hyz7fanhogqxO8uvMHGqL0QtWvHPwd49ul3e8ZIipARna d/xj/5rofzf/ETokFh8pyT4/WB255mAfsCQvc6DDF3Yuj4NmdrYAS73xD0AxTqTgLjdu 82Cg== X-Gm-Message-State: APjAAAXDQ1kQurh/upe7/AZAwOplg1HvJVsOsZ8ipx+AkOSh6XkJPXDw eXsNfzY9YhTOriSesxlCUGmba3p+LrWbX+z51UizMGhcW4KovTNgCDinLPgXifoN6XERPdTm+6g yJ2S/B6TVFPxhpMpD/T9RXaSPKXFzxmC/QOPxpPY1no84IQNUuVn7WLYghx4/uE4ccg== X-Received: by 2002:a17:90a:1b4a:: with SMTP id q68mr5888341pjq.61.1562076980688; Tue, 02 Jul 2019 07:16:20 -0700 (PDT) X-Received: by 2002:a17:90a:1b4a:: with SMTP id q68mr5888296pjq.61.1562076980048; Tue, 02 Jul 2019 07:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562076980; cv=none; d=google.com; s=arc-20160816; b=rfmKLHjTrgJcu8gHQIscEDoLccB7SYxCd99hp9TZx5Y3UG+i+XRvjpFlvVRp2T7ook H3VmoZP8LSrebkz5OOhrSakj09FQDkSFp4wrkCJX93D53t0MCvNZ6iiMJSYVynU4JphJ zaftl8w5qb55FdpzMVSkUgmUi4NjfDSCE6vPt7RE9F8K4aAcLBEerNrQk2lrK7jpQrUT 3+7ZEfapJdCBsx9LDM3ZmK4rwdH1oOzc4M+jRqHKO3yLB2m8SU4W3TRv/ejORQvPrwFK qVA2lfICmpCPyzLVCbN1dz7f5jcjNXPgDoj0BfvBXPe/ZuXe+ABNGzuX5Nedjlz14sOc hqTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=WBzXR4TZZHkqkMNv1E0xRf3mfUwoTzVNVZHPzzbj8rI=; b=cQNerA4ZVPa3YsxDzv7g3Ie+muzZ/cgQSyrZmj7tp4ZysfI7IUmqRQqd/cBjUAGsHH feGUEAGEaM1DC6BEVVcatbLddmRyxWjvLVonEFADNLaEFofkameQfv4pePrfUlGf7zVM iDaSblAr2zAONRsExcc7OAfelpaWVcOZlgPNk01Itafb327d7s+9KJSlR3YneUMuWW2n 2dFjtELsO81QJAHsVnA+S5vSi7Kksq2oc7OKm1zZ9eb8mlwZ7Pg8xsSNAy2lksmTGlYs FSrtcunpuNpTXw5UMu9QN3qfiL/sUFkOjm/J9AW/it75G5QeQ3vCZym9mGNakq3cILLK SHxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KmDmyc9U; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id f35sor15881020plh.33.2019.07.02.07.16.19 for (Google Transport Security); Tue, 02 Jul 2019 07:16:20 -0700 (PDT) Received-SPF: pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KmDmyc9U; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WBzXR4TZZHkqkMNv1E0xRf3mfUwoTzVNVZHPzzbj8rI=; b=KmDmyc9UgitUSKmQSbKjb9DdUtjBdj+AJcQslWKkw6oK98VNaeJDCKYNJj8Xam/2nb q9U5fjB5iElBuHff6OX+alidJnQw5RbNmku59aKFEPCB+P/0rZolEcyYCH+1Ert5OfM2 Xarbe5OEYveIN0ypbc+SAgTrgp9/wO6FCTkr5xOcYmm/gje8u/ya7qWqqX2vkkP1LZPV prGXdZQ0qj250aBKWIAPwh8LOBHtsv5H+KaxEO/9MciMvlqE9ZJXBz+4Kd+xVGj0PDm3 kKVW1Wi0E9CO2PYp7DnGZ9EY2A0l4TeMBvxsHmgBqzWm3wz0Qv/U6RPyHUSVPjADVlY/ y5/Q== X-Google-Smtp-Source: APXvYqwWEAKTT6dyFXv7dzOsiRMsExc4YRB82MDVaOFpGFRbH99CZs+/cOLzM+zyEfvt2oTwz2Gisg== X-Received: by 2002:a17:902:f204:: with SMTP id gn4mr35901637plb.3.1562076979826; Tue, 02 Jul 2019 07:16:19 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:648:b8c3:8577:bf2f:2]) by smtp.gmail.com with ESMTPSA id a5sm744617pjv.21.2019.07.02.07.16.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 07:16:19 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org, peterz@infradead.org, urezki@gmail.com Cc: rpenyaev@suse.de, mhocko@suse.com, guro@fb.com, aryabinin@virtuozzo.com, rppt@linux.ibm.com, mingo@kernel.org, rick.p.edgecombe@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pengfei Li Subject: [PATCH v2 2/5] mm/vmalloc.c: Introduce a wrapper function of insert_vmap_area_augment() Date: Tue, 2 Jul 2019 22:15:38 +0800 Message-Id: <20190702141541.12635-3-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190702141541.12635-1-lpf.vector@gmail.com> References: <20190702141541.12635-1-lpf.vector@gmail.com> MIME-Version: 1.0 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 The red-black tree whose root is free_vmap_area_root is called the *FREE* tree. Like the previous commit, add wrapper functions insert_va_to_free_tree and rename insert_vmap_area_augment to __insert_vmap_area_augment. Signed-off-by: Pengfei Li --- mm/vmalloc.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 0a46be76c63b..a5065fcb74d3 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -658,7 +658,7 @@ insert_va_to_busy_tree(struct vmap_area *va) } static void -insert_vmap_area_augment(struct vmap_area *va, +__insert_vmap_area_augment(struct vmap_area *va, struct rb_node *from, struct rb_root *root, struct list_head *head) { @@ -674,6 +674,13 @@ insert_vmap_area_augment(struct vmap_area *va, augment_tree_propagate_from(va); } +static __always_inline void +insert_va_to_free_tree(struct vmap_area *va, struct rb_node *from) +{ + __insert_vmap_area_augment(va, from, &free_vmap_area_root, + &free_vmap_area_list); +} + /* * Merge de-allocated chunk of VA memory with previous * and next free blocks. If coalesce is not done a new @@ -979,8 +986,7 @@ adjust_va_to_fit_type(struct vmap_area *va, augment_tree_propagate_from(va); if (lva) /* type == NE_FIT_TYPE */ - insert_vmap_area_augment(lva, &va->rb_node, - &free_vmap_area_root, &free_vmap_area_list); + insert_va_to_free_tree(lva, &va->rb_node); } return 0; @@ -1822,9 +1828,7 @@ static void vmap_init_free_space(void) free->va_start = vmap_start; free->va_end = busy->va_start; - insert_vmap_area_augment(free, NULL, - &free_vmap_area_root, - &free_vmap_area_list); + insert_va_to_free_tree(free, NULL); } } @@ -1837,9 +1841,7 @@ static void vmap_init_free_space(void) free->va_start = vmap_start; free->va_end = vmap_end; - insert_vmap_area_augment(free, NULL, - &free_vmap_area_root, - &free_vmap_area_list); + insert_va_to_free_tree(free, NULL); } } } From patchwork Tue Jul 2 14:15:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pengfei Li X-Patchwork-Id: 11027923 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 6039E112C for ; Tue, 2 Jul 2019 14:16:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4690228866 for ; Tue, 2 Jul 2019 14:16:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A3E828891; Tue, 2 Jul 2019 14:16:32 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 D507F28866 for ; Tue, 2 Jul 2019 14:16:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F015B8E0006; Tue, 2 Jul 2019 10:16:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EB27D8E0001; Tue, 2 Jul 2019 10:16:30 -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 DA15B8E0006; Tue, 2 Jul 2019 10:16:30 -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 A2FDC8E0001 for ; Tue, 2 Jul 2019 10:16:30 -0400 (EDT) Received: by mail-pf1-f199.google.com with SMTP id 145so4531108pfw.16 for ; Tue, 02 Jul 2019 07:16:30 -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:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=G8O9YGTZsZSZcNV2syt7QHGA27EpzoxaGp70ElDSGVs=; b=VqtotZnsqZFMQjCfe27BegOqFnujt8jOkugxpePlzAwowx9JFYZpjQu7+qAaU4FSQd ZvyWLrFoGmN9GJob4rIvuzKwNK3hnWO75e3dgxQiX1O0RuXI7+bVvh6zD2vQWylbVngw CamobNDTvS13Qo7KiMRynt5CpQav+j1U9qvBcvIZSg/8ilIt+/DHdV9SsR4k7SGZ+snD Cy9S/m+lNslYQgxMwC1QRDdXRi9tD4bPpniMfV79jEB7C3mlUVi+vOLIt9XQaHNiuEJi AM+MPulXXZzI/hb3EuRkl0SbUq2RsmTboRCUDc+2Npg2FowYn/KET5jheN7mdO6f4qlt 1uXw== X-Gm-Message-State: APjAAAWiXgm20avRJNN9igvrIeeCSCoVIA94qN+YXSO+Cr218PO2xVMb lg3+dusUIrGqFQjr0mr1oGsk6OpvvXANu16utQV8057hpGmBTq/vZqWxh/2eL6ngS3ryvJzo75A meCXkrUbxy5eOcjWniqLqRhgPCgINKMytlrcembVSSDry+foDds0Tx9mdbhKK4BBO8A== X-Received: by 2002:a17:90a:b115:: with SMTP id z21mr5907654pjq.64.1562076990269; Tue, 02 Jul 2019 07:16:30 -0700 (PDT) X-Received: by 2002:a17:90a:b115:: with SMTP id z21mr5907593pjq.64.1562076989485; Tue, 02 Jul 2019 07:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562076989; cv=none; d=google.com; s=arc-20160816; b=iQEUvJbnyUuGemYlUey9jyjIz9o9k4aVqdMcCJaE9uh32LEeLIJ4+FWf5MH/+Ja7aR wsYegAQH/y4K7yQPnYgGxKliSo+C/7qFF6uO3amjghBQIxabWmzmE+liKKAW3KXrWhQZ QVLejSWg/Xhdh6u/dTO7mSTKhDZXEXJb2bwa0GyNFMroZJtbgy4a9qyN4YVZgfFWdUcs U0NOO45Sc+wOSCVt1sj6nrrIaeUCbyrj9WW3HfktFaNuG3w0hr03kfRVnNboJhNlj48B Hm4fK9AgkM8c8su6IXpq3mGgD2xRsQjrxFMzRuPMQI3k8YtQlUu6zg/VjYtv5M16ozNB 9vEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=G8O9YGTZsZSZcNV2syt7QHGA27EpzoxaGp70ElDSGVs=; b=PRHoRmrAGSr0sN9vXW4QuTEjny7LcMFCl8A7kNHk5v+qK2zZyjl4xflXerKgV9r2gY HF9LEsLCH+neJ56gKnXZhzUjELVrERryzyd5Sr53VSAIU6ykje25uCVFXlPoTOn9oJcZ L7w+qZI8377EMgY8S5KQRblbTttaophSlSuqkjivzV+iPvlEO1BtMa40VjQdXCmPkJYC fJQf/rwl9zRQ0ERHFyjEtqrOyICfCBUYvAc8QpSX5ZNBr5Z20gPyZmAyeNjsA8q5RoGg SlU3l25npCLHb2m2sOPmQhmWlzjm8FLKAlLN12D0b70PEIjNVcWchdLSVAf/zCaqDOtQ b48A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gHjHjhpu; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b64sor3549498pjc.24.2019.07.02.07.16.29 for (Google Transport Security); Tue, 02 Jul 2019 07:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gHjHjhpu; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G8O9YGTZsZSZcNV2syt7QHGA27EpzoxaGp70ElDSGVs=; b=gHjHjhpuTNFRjW6geiXwx4SxHlaljBV0ZdtUgREKxzgVNiTbp3EFo3iTPJceIBR4It oUKt3V6ZSBWZLf5SRxftMNzHmzysU0SJG2vfqsXjHyT0kXBZISdHDSEysQFqSH6OTYJC rrhp4F4yUa06njImZ8H/cA0nC8QpnQi31mjRGbQ7zADeoC6KHG8p4y9jc6obk46hKGrQ RaWVl199RMIUZKuE3QIBIWbdMP9rmHlRrFp2/rDFUQClotk7ahVjmNy38rFo8Y9TyB7f kRpJa689c3ikpSC6QRhxv8C+SOPr+r81+L+4jkQ/PXpz8UvfvRFaVyU2+6TFMinUkrve 7heA== X-Google-Smtp-Source: APXvYqySwVE9Fh+614x2kyb57wZjPWabmz8Qpui29yVSRTKwoZaH6ufwyye8S/75FbHZEacWu15FjQ== X-Received: by 2002:a17:90a:e38f:: with SMTP id b15mr5996459pjz.85.1562076989286; Tue, 02 Jul 2019 07:16:29 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:648:b8c3:8577:bf2f:2]) by smtp.gmail.com with ESMTPSA id a5sm744617pjv.21.2019.07.02.07.16.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 07:16:28 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org, peterz@infradead.org, urezki@gmail.com Cc: rpenyaev@suse.de, mhocko@suse.com, guro@fb.com, aryabinin@virtuozzo.com, rppt@linux.ibm.com, mingo@kernel.org, rick.p.edgecombe@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pengfei Li Subject: [PATCH v2 3/5] mm/vmalloc.c: Rename function __find_vmap_area() for readability Date: Tue, 2 Jul 2019 22:15:39 +0800 Message-Id: <20190702141541.12635-4-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190702141541.12635-1-lpf.vector@gmail.com> References: <20190702141541.12635-1-lpf.vector@gmail.com> MIME-Version: 1.0 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 Rename function __find_vmap_area to __search_va_in_busy_tree to indicate that it is searching in the *BUSY* tree. Signed-off-by: Pengfei Li --- mm/vmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index a5065fcb74d3..b6ea52d6e8f9 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -399,7 +399,7 @@ static void purge_vmap_area_lazy(void); static BLOCKING_NOTIFIER_HEAD(vmap_notify_list); static unsigned long lazy_max_pages(void); -static struct vmap_area *__find_vmap_area(unsigned long addr) +static struct vmap_area *__search_va_in_busy_tree(unsigned long addr) { struct rb_node *n = vmap_area_root.rb_node; @@ -1313,7 +1313,7 @@ static struct vmap_area *find_vmap_area(unsigned long addr) struct vmap_area *va; spin_lock(&vmap_area_lock); - va = __find_vmap_area(addr); + va = __search_va_in_busy_tree(addr); spin_unlock(&vmap_area_lock); return va; From patchwork Tue Jul 2 14:15:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pengfei Li X-Patchwork-Id: 11027925 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 E9DB2112C for ; Tue, 2 Jul 2019 14:16:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0C8228866 for ; Tue, 2 Jul 2019 14:16:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C496828894; Tue, 2 Jul 2019 14:16:42 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 46C4D28866 for ; Tue, 2 Jul 2019 14:16:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5DAEF8E0007; Tue, 2 Jul 2019 10:16:41 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5B1698E0001; Tue, 2 Jul 2019 10:16:41 -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 4C8A88E0007; Tue, 2 Jul 2019 10:16:41 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id 13F2E8E0001 for ; Tue, 2 Jul 2019 10:16:41 -0400 (EDT) Received: by mail-pg1-f198.google.com with SMTP id b18so8120882pgg.8 for ; Tue, 02 Jul 2019 07:16:41 -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:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=IVRfR6NM4S8GzqtG5KCitdmBC8Cn7LE2ANcDk6NxhUc=; b=Nnvqhw10DBMDQoi0f+N/00hen3hlilWwKnLabUdV1uquaZZaBXmrPMqJz78w6wQHMw zV8vbH5i9imfKPQ7/vwWq1nKThfst6nXcMrfpkzIvqcKexNSQAhufbCCWpHsBeg80sau V7+bOECdyfkGpTvTwRYVlILYT7/pA3Uxeq91UVbdcdxlBZfuNj9m1cc/QKC7E9rdWeS/ I6g+2+lUqaIIx32kHEDlKB4TPT/roO3RzQNj+Pq/4sqMQTjtWXvseHjiH4plXicgi+ua bjiJt1x7ZtX2GudpD+c54fpSjs4S0ZBg3lBWkkudIjYIlMVGlUMO55OmhqzS2O2DK7H2 LpTw== X-Gm-Message-State: APjAAAXK/SbUN+/INmPvbwB+Mmlf2w0DdAXp8ZjXFrfc5DixOOIzO5mI j5hol08eaNDWC7O4Z0zStzRswW/yg93F4UxyWNvlJlLkLVYbGm9TC0IIMpe16ui2gEYsJeUzkVL FudJdE1b4IfC1ntDhnApxWvG/CIQp1g4ZC5Lq3OcHQx2Nb6CXaTQvgCx7nuya6VZfAA== X-Received: by 2002:a63:1a5e:: with SMTP id a30mr2726035pgm.433.1562077000328; Tue, 02 Jul 2019 07:16:40 -0700 (PDT) X-Received: by 2002:a63:1a5e:: with SMTP id a30mr2725949pgm.433.1562076999190; Tue, 02 Jul 2019 07:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562076999; cv=none; d=google.com; s=arc-20160816; b=aKoSs1WcZQl4Q8i/wSGFH8jiMMmhI+I1+8nVLX0R7coCLqcXbUkrV3Lk6boxLJJbI9 +vOsij3panhPE2X4px/8oOqE0nV0QYQYZmiXOFEdArzRpcc9mewiBU7FyGI3Ce+EgNLh 0s+L5cZshArbzycxhAliITDaiYDdZ3WwcwvdbyQTj4O9WRwVjy+hgYsxEaEi165ApMl2 iDZnh8eboudOrhhlASS1kPWZaLrCqFD8/6hkTrJl1PYPdnWQUT9Vu8MixLHNkp4lfSHH 6PeMOGnm5frJ7Ms3AMP3dKZ5IMLhSbVpXt+I1A7e2TRt0FR4NkoeZqKps24/JFTSM9Py mAMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=IVRfR6NM4S8GzqtG5KCitdmBC8Cn7LE2ANcDk6NxhUc=; b=Hi1RleiyzsG4Shx0rhEj9ufkb5okzftpOaI84PnhNszqF1NVjHE+4O2k5YinHcHCZX jP2K/B1wVb52EiVF49x4LB5f2x31ai4BlYL6pZ9R+ohD2qHSsIy128gWpFxQpnMTEhwT ujYTmOJap/CmM2p4/qCEEEwyCjYlpVkV0OA0/HVG9mGDjE+pyjVIgO7qqAYK/Pibtd4Y /ZnFNH/+LCxEPqw7RDH4LBjEIWlUFLUGPDA2Bjcd2JHLAIa6VxWf2XT3ckXY/EpTAJbe UefO68syGzGmU9z0Xo4WeZHbBuTMfac8pXGMkTxMGSJlY0QjuM67ZkjFL6e5HBfaDR3x t/hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mbKvkclP; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i21sor6044771pgm.59.2019.07.02.07.16.39 for (Google Transport Security); Tue, 02 Jul 2019 07:16:39 -0700 (PDT) Received-SPF: pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mbKvkclP; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IVRfR6NM4S8GzqtG5KCitdmBC8Cn7LE2ANcDk6NxhUc=; b=mbKvkclPmFUJfZ2BNiNdItDhjCyGfK7ziPIk8X2MQSOaal0E4QVPb5XGQl0tlGNvxj PochgRHedWGDb5LSBTRtwtBSg8FDa6whQjyIIbPU3ehHKvD37K3rj2csePiwSuxleICR jfL/0JSTIRE0KNnhs0cUh3Xl/uDQKCaDPIUvJr4k9IJiu25l72kb1HiuUVgex9ZkIJC7 zu1vmcWbSGSXA2XZQLalwzuM0SxaoLMmXMU5ZeDE35kGus1dI4cLGhroTDfneam3WGtr MbNUdyDXTG/5m4z0feZT0K0Ztg5bkD9oQEaM8w7/V177L20h8WorWWVXXq4yOQEDbBYZ rpUg== X-Google-Smtp-Source: APXvYqylAAUdACn1rF5L88n+GFa56x8++h4rnLVraMjKleLyTPC2fVgcloQNhaYHZMsu7woqKPmeWg== X-Received: by 2002:a63:e018:: with SMTP id e24mr30628200pgh.361.1562076998890; Tue, 02 Jul 2019 07:16:38 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:648:b8c3:8577:bf2f:2]) by smtp.gmail.com with ESMTPSA id a5sm744617pjv.21.2019.07.02.07.16.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 07:16:38 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org, peterz@infradead.org, urezki@gmail.com Cc: rpenyaev@suse.de, mhocko@suse.com, guro@fb.com, aryabinin@virtuozzo.com, rppt@linux.ibm.com, mingo@kernel.org, rick.p.edgecombe@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pengfei Li Subject: [PATCH v2 4/5] mm/vmalloc.c: Modify function merge_or_add_vmap_area() for readability Date: Tue, 2 Jul 2019 22:15:40 +0800 Message-Id: <20190702141541.12635-5-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190702141541.12635-1-lpf.vector@gmail.com> References: <20190702141541.12635-1-lpf.vector@gmail.com> MIME-Version: 1.0 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 Since function merge_or_add_vmap_area() is only used to merge or add vmap area to the *FREE* tree, so rename it to merge_or_add_va_to_free_tree. Then this is obvious, merge_or_add_vmap_area() does not need parameters root and head, so remove them. Signed-off-by: Pengfei Li --- mm/vmalloc.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index b6ea52d6e8f9..ad117d16af34 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -688,8 +688,7 @@ insert_va_to_free_tree(struct vmap_area *va, struct rb_node *from) * freed. */ static __always_inline void -merge_or_add_vmap_area(struct vmap_area *va, - struct rb_root *root, struct list_head *head) +merge_or_add_va_to_free_tree(struct vmap_area *va) { struct vmap_area *sibling; struct list_head *next; @@ -701,7 +700,7 @@ merge_or_add_vmap_area(struct vmap_area *va, * Find a place in the tree where VA potentially will be * inserted, unless it is merged with its sibling/siblings. */ - link = find_va_links(va, root, NULL, &parent); + link = find_va_links(va, &free_vmap_area_root, NULL, &parent); /* * Get next node of VA to check if merging can be done. @@ -717,7 +716,7 @@ merge_or_add_vmap_area(struct vmap_area *va, * | | * start end */ - if (next != head) { + if (next != &free_vmap_area_list) { sibling = list_entry(next, struct vmap_area, list); if (sibling->va_start == va->va_end) { sibling->va_start = va->va_start; @@ -725,9 +724,6 @@ merge_or_add_vmap_area(struct vmap_area *va, /* Check and update the tree if needed. */ augment_tree_propagate_from(sibling); - /* Remove this VA, it has been merged. */ - unlink_va(va, root); - /* Free vmap_area object. */ kmem_cache_free(vmap_area_cachep, va); @@ -744,7 +740,7 @@ merge_or_add_vmap_area(struct vmap_area *va, * | | * start end */ - if (next->prev != head) { + if (next->prev != &free_vmap_area_list) { sibling = list_entry(next->prev, struct vmap_area, list); if (sibling->va_end == va->va_start) { sibling->va_end = va->va_end; @@ -753,7 +749,8 @@ merge_or_add_vmap_area(struct vmap_area *va, augment_tree_propagate_from(sibling); /* Remove this VA, it has been merged. */ - unlink_va(va, root); + if (merged) + unlink_va(va, &free_vmap_area_root); /* Free vmap_area object. */ kmem_cache_free(vmap_area_cachep, va); @@ -764,7 +761,8 @@ merge_or_add_vmap_area(struct vmap_area *va, insert: if (!merged) { - link_va(va, root, parent, link, head); + link_va(va, &free_vmap_area_root, parent, link, + &free_vmap_area_list); augment_tree_propagate_from(va); } } @@ -1141,8 +1139,7 @@ static void __free_vmap_area(struct vmap_area *va) /* * Merge VA with its neighbors, otherwise just add it. */ - merge_or_add_vmap_area(va, - &free_vmap_area_root, &free_vmap_area_list); + merge_or_add_va_to_free_tree(va); } /* From patchwork Tue Jul 2 14:15:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pengfei Li X-Patchwork-Id: 11027927 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 2C1221580 for ; Tue, 2 Jul 2019 14:16:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1166528866 for ; Tue, 2 Jul 2019 14:16:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0435C28891; Tue, 2 Jul 2019 14:16:53 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 B3B1328866 for ; Tue, 2 Jul 2019 14:16:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B322B8E0008; Tue, 2 Jul 2019 10:16:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B09468E0001; Tue, 2 Jul 2019 10:16:50 -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 9D05F8E0008; Tue, 2 Jul 2019 10:16:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id 628C88E0001 for ; Tue, 2 Jul 2019 10:16:50 -0400 (EDT) Received: by mail-pg1-f198.google.com with SMTP id i13so1036443pgq.3 for ; Tue, 02 Jul 2019 07:16:50 -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:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CO1HonlQmPbMkXDhRXg7GyAorrH54gcigaOJMEfOSWg=; b=iBUD+lfrphuu5v784jRforRu8meCdBn410Uav3/cBreGT2SnbuDVNKTkz90Rpfb33s tAoP0DJCnZg92iRdxRfcvpoDIm0mtMj2wDOoFns2ZPZS1SkXg+rMCKHDaOpfHFcs8Y+7 iWwNMsX7jB0j4kOhQG/fY8WuUHYhiqNfUNFyJ5VkV8GBsiZiHaGMbxMHr5edMnV+zn2H 1947zjIM/o85ZPdycBnnJ1S7JK7YHbANMB+uEdeyG6qQScq5mkEwrXKQ3gsFYOpqzRe0 B/OKsgKlfDD6PaMiD5bDRKzcouRwHW/MymOtZCT5QC1vcFM1K8ZIdj2TjQooLdbcfqHI 0bjw== X-Gm-Message-State: APjAAAW5TJrzIEZxisketqg5dQ+Y42Hh95LkHGLntRC6T56WEG22+V2a ktWaJoGZn6qR7c2NFNGpxxRc6VoFCHxNRen8T5e1hKGMkORLCNjYptX/t8J+bteRkFGjR54NHZe 1QpOKZ7O3haJJoKq3tSdD5xjMXxaIPRz1Dl+ziIbq/pIKZuVEW/S7NMcTxr3htYHfhA== X-Received: by 2002:a17:902:6b44:: with SMTP id g4mr35333954plt.152.1562077010032; Tue, 02 Jul 2019 07:16:50 -0700 (PDT) X-Received: by 2002:a17:902:6b44:: with SMTP id g4mr35333863plt.152.1562077008944; Tue, 02 Jul 2019 07:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562077008; cv=none; d=google.com; s=arc-20160816; b=H8Y9fLMK3TBEOfrNniq6MDE6O4bINp89Z2BuSW2/5RyGg+FLKSXnA2BtRSOlbbX7Bt wHkIYWPwbhZodSDMJac3xP8m0sOcBRAv7k2S3YS096nbK0MHCiTCmtxdW40kah+cQDBh pAKVngT6q3S/r2Lzfc5CoNP6DqGVG+v7f4dP4Cv+tjbQz6kGP2FGe0FRwltNlzezxpfm xDGC3QPAQjR4D792JrqmUl/obQtNknr8DbPP2ipT7HBPFI038S36PDqLhNiRULByFx87 2QS4R6JV0G2djuNoN0raOThsOVfk6bG7o0jPeNKfj7LgFimjSPmCm5OSWKuemZiImO1w qdlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=CO1HonlQmPbMkXDhRXg7GyAorrH54gcigaOJMEfOSWg=; b=t7lrgD5vQU0LKhGMCFSUkKiYolIsLcqk7p3IgJuKrz3OLFyAlcdBDjGP8Qzq7XjjLS /flJ4T+6gZx1/uxFCKezhNTIctyROztmFM1fDW/vKjFbJ97kNWWgy/zRFD1i6kU8c2Ql 0mwelND5m7YyIZc4EiZrt7AUB7d8/MY9XLgqDpvRyLeonGd5uePjIEAoJifNGpWskDxa /cUA8i1mEXCzkdOfFa32YIlcn+aneebQUjRL4eoEnAL0PaeY7rOU7M/GPYaR1jw4wq8o ivcjMs9B7ckt5SBq9iXVa3rgXVwiI8VP7z6EgjLPvxdlxWH1FLji/1YeK41qG2HkXgcd tC6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=niR9yO0Y; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id a20sor6575963pgm.3.2019.07.02.07.16.48 for (Google Transport Security); Tue, 02 Jul 2019 07:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=niR9yO0Y; spf=pass (google.com: domain of lpf.vector@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=lpf.vector@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CO1HonlQmPbMkXDhRXg7GyAorrH54gcigaOJMEfOSWg=; b=niR9yO0Y/6o7iMNZeCRrGiwL+NCvbnvMkK++I7yQezM12HqY5Om9yRWzwzgpOmCDzp 3sb9lK454kLeAXM7oZsP6/OtTazGiNWNT542jvQbXsmwSzMkrTMcnUeH6Qe1AnilDLBf AdcBWSskv9foofZdhLVVJVy4K+EuA7/Ar2r7m4tcJJt+aTsY5ooeib84iEsF5Fg4bdpT rkBatzipJ/lY2NhGYA+TwY3w+A4cIACybC+cUjGRoZFC0I0tJc2IxerM2y47NnVm9Q3l 5fsPC2Otl/tgrUKoI/pt5S00yDdQYqFWd51+Fz+6xrrmS5QppxCxm0pcKF3FU3oFc5Ft uLxQ== X-Google-Smtp-Source: APXvYqzJbwkaxbHtL6VK4vg0aa1y5tweDY+u4FYqKxaFH2XhqHmwVbU5lZzvniumVZ6N9r+MAq6xPg== X-Received: by 2002:a63:c508:: with SMTP id f8mr50576pgd.48.1562077008475; Tue, 02 Jul 2019 07:16:48 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:648:b8c3:8577:bf2f:2]) by smtp.gmail.com with ESMTPSA id a5sm744617pjv.21.2019.07.02.07.16.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 07:16:48 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org, peterz@infradead.org, urezki@gmail.com Cc: rpenyaev@suse.de, mhocko@suse.com, guro@fb.com, aryabinin@virtuozzo.com, rppt@linux.ibm.com, mingo@kernel.org, rick.p.edgecombe@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pengfei Li Subject: [PATCH v2 5/5] mm/vmalloc.c: Rewrite struct vmap_area to reduce its size Date: Tue, 2 Jul 2019 22:15:41 +0800 Message-Id: <20190702141541.12635-6-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190702141541.12635-1-lpf.vector@gmail.com> References: <20190702141541.12635-1-lpf.vector@gmail.com> MIME-Version: 1.0 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 Objective --------- The current implementation of struct vmap_area wasted space. At the determined stage, not all members of the structure will be used. For this problem, this commit places multiple structural members that are not being used at the same time into a union to reduce the size of the structure. And local test results show that this commit will not hurt performance. After applying this commit, sizeof(struct vmap_area) has been reduced from 11 words to 8 words. Description ----------- Members of struct vmap_area are not being used at the same time. For example, (1)members @flags, @purge_list, and @vm are unused when vmap area is in the *FREE* tree; (2)members @subtree_max_size and @purge_list are unused when vmap area is in the *BUSY* tree and not in the purge list; (3)members @subtree_max_size and @vm are unused when vmap area is in the *BUSY* tree and in the purge list. Since members @subtree_max_size, @purge_list and @vm are not used at the same time, so they can be placed in a union to reduce the size of struct vmap_area. Besides, since PAGE_ALIGNED(va->va_start) is always true, then @flags and @va_start can be placed in a union, and @flags use bits below PAGE_SHIFT. After that, the value of @va_start can be corrected by masking @flags. Performance Testing ------------------- Test procedure -------------- Test result ----------- (1)Base (5.2.0-rc7) Test items round_1 round_2 round_3 fix_size_alloc_test 596666 usec 600600 usec 597993 usec full_fit_alloc_test 632614 usec 623770 usec 633657 usec long_busy_list_alloc_test 8139257 usec 8162904 usec 8234770 usec random_size_alloc_test 4332230 usec 4335376 usec 4322771 usec fix_align_alloc_test 1184827 usec 1133574 usec 1148328 usec random_size_align_alloc_test 1459814 usec 1467915 usec 1465112 usec pcpu_alloc_test 92053 usec 93290 usec 92439 usec (2)Patched (5.2.0-rc7 + this series of patches) Test items round_1 round_2 round_3 fix_size_alloc_test 607753 usec 602034 usec 584153 usec full_fit_alloc_test 593415 usec 627681 usec 634853 usec long_busy_list_alloc_test 8038797 usec 8012176 usec 8152911 usec random_size_alloc_test 4304070 usec 4327863 usec 4588769 usec fix_align_alloc_test 1122373 usec 1108628 usec 1145592 usec random_size_align_alloc_test 1449265 usec 1475160 usec 1479629 usec pcpu_alloc_test 93856 usec 91697 usec 92658 usec (3) Average comparison Test items Avg_base Avg_patched fix_size_alloc_test 598419.6667 usec 597980.0000 usec full_fit_alloc_test 630013.6667 usec 618649.6667 usec long_busy_list_alloc_test 8178977.0000 usec 8067961.3333 usec random_size_alloc_test 4330125.6667 usec 4406900.6667 usec fix_align_alloc_test 1155576.3333 usec 1125531.0000 usec random_size_align_alloc_test 1464280.3333 usec 1468018.0000 usec pcpu_alloc_test 92594.0000 usec 92737.0000 usec (4) Percentage difference Test items (Avg_base - Avg_patched) / Avg_base fix_size_alloc_test 0.0735% full_fit_alloc_test 1.8038% long_busy_list_alloc_test 1.3573% random_size_alloc_test -1.7730% fix_align_alloc_test 2.6000% random_size_align_alloc_test -0.2553% pcpu_alloc_test -0.1544% Result analysis --------------- Because the test results vary within a range, we can conclude that this commit does not cause a significant impact on performance. Signed-off-by: Pengfei Li --- include/linux/vmalloc.h | 28 ++++++++++---- mm/vmalloc.c | 82 +++++++++++++++++++++++++++++++++-------- 2 files changed, 87 insertions(+), 23 deletions(-) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 51e131245379..bc23d59cf5ae 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -48,18 +48,30 @@ struct vm_struct { }; struct vmap_area { - unsigned long va_start; + union { + unsigned long va_start; + /* + * Only used when vmap area is in the *BUSY* tree + * and not in the purge_list. + */ + unsigned long flags; + }; + unsigned long va_end; - /* - * Largest available free size in subtree. - */ - unsigned long subtree_max_size; - unsigned long flags; + union { + /* Only used when vmap area is in the *FREE* tree */ + unsigned long subtree_max_size; + + /* Only used when vmap area is in the vmap_purge_list */ + struct llist_node purge_list; + + /* Only used when the VM_VM_AREA flag is set */ + struct vm_struct *vm; + }; + struct rb_node rb_node; /* address sorted rbtree */ struct list_head list; /* address sorted list */ - struct llist_node purge_list; /* "lazy purge" list */ - struct vm_struct *vm; }; /* diff --git a/mm/vmalloc.c b/mm/vmalloc.c index ad117d16af34..c7e59bc54024 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -329,8 +329,50 @@ EXPORT_SYMBOL(vmalloc_to_pfn); #define DEBUG_AUGMENT_PROPAGATE_CHECK 0 #define DEBUG_AUGMENT_LOWEST_MATCH_CHECK 0 -#define VM_LAZY_FREE 0x02 -#define VM_VM_AREA 0x04 + +/* + * For vmap area in the *BUSY* tree, PAGE_ALIGNED(va->va_start) + * is always true. + * This is guaranteed by calling BUG_ON(offset_in_page(size)) + * and BUG_ON(!PAGE_ALIGNED(addr)). + * So define MAX_VA_FLAGS_SHIFT as PAGE_SHIFT. + */ +#define MAX_VA_FLAGS_SHIFT PAGE_SHIFT + +enum VA_FlAGS_TYPE { + VM_VM_AREA = 0x1UL, + + /* + * The value of newly added flags should be between + * VM_VM_AREA and LAST_VMAP_AREA_FLAGS. + */ + + LAST_VMAP_AREA_FLAGS = (1UL << MAX_VA_FLAGS_SHIFT) +}; + +#define VMAP_AREA_FLAGS_MASK (~(LAST_VMAP_AREA_FLAGS - 1)) + +/* + * va->flags should be set with this helper function to ensure + * the correctness of the flag being set, instead of directly + * modifying the va->flags. + */ +static __always_inline void +set_va_flags(struct vmap_area *va, enum VA_FlAGS_TYPE flag) +{ + BUILD_BUG_ON(!is_power_of_2(flag)); + + BUILD_BUG_ON(flag >= LAST_VMAP_AREA_FLAGS); + + va->flags |= flag; +} + +/* Return the correct value of va->va_start by masking flags */ +static __always_inline unsigned long +get_va_start(struct vmap_area *va) +{ + return (va->va_start & VMAP_AREA_FLAGS_MASK); +} static DEFINE_SPINLOCK(vmap_area_lock); /* Export for kexec only */ @@ -399,6 +441,11 @@ static void purge_vmap_area_lazy(void); static BLOCKING_NOTIFIER_HEAD(vmap_notify_list); static unsigned long lazy_max_pages(void); +/* + * va->va_start may contain the value of flags when vmap area is in + * the *BUSY* tree, so use the helper function get_va_start() to get + * the value of va_start instead of directly accessing it. + */ static struct vmap_area *__search_va_in_busy_tree(unsigned long addr) { struct rb_node *n = vmap_area_root.rb_node; @@ -407,7 +454,7 @@ static struct vmap_area *__search_va_in_busy_tree(unsigned long addr) struct vmap_area *va; va = rb_entry(n, struct vmap_area, rb_node); - if (addr < va->va_start) + if (addr < get_va_start(va)) n = n->rb_left; else if (addr >= va->va_end) n = n->rb_right; @@ -454,9 +501,9 @@ find_va_links(struct vmap_area *va, * or full overlaps. */ if (va->va_start < tmp_va->va_end && - va->va_end <= tmp_va->va_start) + va->va_end <= get_va_start(tmp_va)) link = &(*link)->rb_left; - else if (va->va_end > tmp_va->va_start && + else if (va->va_end > get_va_start(tmp_va) && va->va_start >= tmp_va->va_end) link = &(*link)->rb_right; else @@ -1079,8 +1126,8 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, va->va_start = addr; va->va_end = addr + size; - va->flags = 0; insert_va_to_busy_tree(va); + va->vm = NULL; spin_unlock(&vmap_area_lock); @@ -1872,11 +1919,12 @@ void __init vmalloc_init(void) if (WARN_ON_ONCE(!va)) continue; - va->flags = VM_VM_AREA; va->va_start = (unsigned long)tmp->addr; va->va_end = va->va_start + tmp->size; - va->vm = tmp; insert_va_to_busy_tree(va); + + set_va_flags(va, VM_VM_AREA); + va->vm = tmp; } /* @@ -1969,8 +2017,10 @@ static void setup_vmalloc_vm(struct vm_struct *vm, struct vmap_area *va, vm->addr = (void *)va->va_start; vm->size = va->va_end - va->va_start; vm->caller = caller; + + set_va_flags(va, VM_VM_AREA); va->vm = vm; - va->flags |= VM_VM_AREA; + spin_unlock(&vmap_area_lock); } @@ -2102,9 +2152,11 @@ struct vm_struct *remove_vm_area(const void *addr) struct vm_struct *vm = va->vm; spin_lock(&vmap_area_lock); - va->vm = NULL; - va->flags &= ~VM_VM_AREA; - va->flags |= VM_LAZY_FREE; + /* + * Restore the value of va_start by masking flags + * before adding vmap area to the purge list. + */ + va->va_start = get_va_start(va); spin_unlock(&vmap_area_lock); kasan_free_shadow(vm); @@ -3412,9 +3464,9 @@ static int s_show(struct seq_file *m, void *p) */ if (!(va->flags & VM_VM_AREA)) { seq_printf(m, "0x%pK-0x%pK %7ld %s\n", - (void *)va->va_start, (void *)va->va_end, - va->va_end - va->va_start, - va->flags & VM_LAZY_FREE ? "unpurged vm_area" : "vm_map_ram"); + (void *)get_va_start(va), (void *)va->va_end, + va->va_end - get_va_start(va), + va->vm ? "unpurged vm_area" : "vm_map_ram"); return 0; }