Received: by 10.213.65.68 with SMTP id h4csp783953imn; Tue, 27 Mar 2018 08:42:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELu0VUll84XTl1n2+J1VWMvXPI4hs7mMINRw1JoyYZZ3c3qjHbfytd65O218TDMcLlddajnd X-Received: by 2002:a17:902:8697:: with SMTP id g23-v6mr46837990plo.393.1522165336895; Tue, 27 Mar 2018 08:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522165336; cv=none; d=google.com; s=arc-20160816; b=gRa2443FJ2hy369pHNHRspfyzfTihoO3iBULwlhFgpRuSFLLvgVtmD/a7jfiBBFKSB xxrI1lWHJgrrg2iLTqSnKPkjWE60cYDrkDMULNEdpsCLdSa/yQOfK/HgEde1DLHL0evm cwT5jP9d72eXGh26/NJCIutVQ5U3F7Ntdls3PDwtrcGLQX/1hvQ25dE7MF4oiywhw1/s gwi3nTgqRhCwaoUIsu/LPVnNwBkP940zChDZ6JQnsNmoKRWdQ0GqQY+nJNup8odBK8GK 2tI7mK/uXACBewatJwQUM2sFQqGMenL1szbdNB+PfonXL8RpRrhD1iXVyljW4SdWeBGv OqIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=OYIHO1E2FYttMwneu+ZKZ5RJfEzIKDHgu84G5IWf0uw=; b=cJiIMkc2ZW5GEc1NlMv31eCkVKMDzo1s1C87Dyo0FcbPK74yPnHjriJRPCpe1q8l4C 4p/+gIDU553pEVjymB3eDw4uoX8Lk1qUlln0RiNRJs5T/tu9RYPms/V/2/y8As0vwB6K Ihcvq7QG0863monTZjTiqyg9bL41zK4ahnicT0ZnIjeIh1gS4GMQNwSit2dGZIEt5CY4 eaGxEgmHJ1yuz1elrLb9PxHopISOFIckDddUagKaHR12cANDJiXbyNipa+pUqnBJcQyQ 4zvUBnPks0S/HApSmfJhyS9X7nhm6kFWum1fTjoOmPjHCgTj0mx6TG7Wt/kurcacxz7S 67IA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si1002511pgv.577.2018.03.27.08.42.02; Tue, 27 Mar 2018 08:42:16 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752792AbeC0Pjn (ORCPT + 99 others); Tue, 27 Mar 2018 11:39:43 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:30948 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752413AbeC0Pjl (ORCPT ); Tue, 27 Mar 2018 11:39:41 -0400 Received: from LHREML713-CAH.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 32B031B12749B; Tue, 27 Mar 2018 16:39:38 +0100 (IST) Received: from localhost.localdomain (10.122.225.51) by smtpsuk.huawei.com (10.201.108.36) with Microsoft SMTP Server (TLS) id 14.3.382.0; Tue, 27 Mar 2018 16:39:29 +0100 From: Igor Stoppa To: , , CC: , , , , , , , , Igor Stoppa Subject: [PATCH 2/6] vmalloc: rename llist field in vmap_area Date: Tue, 27 Mar 2018 18:37:38 +0300 Message-ID: <20180327153742.17328-3-igor.stoppa@huawei.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180327153742.17328-1-igor.stoppa@huawei.com> References: <20180327153742.17328-1-igor.stoppa@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.122.225.51] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vmap_area structure has a field of type struct llist_node, named purge_list and is used when performing lazy purge of the area. Such field is left unused during the actual utilization of the structure. This patch renames the field to a more generic "area_list", to allow for utilization outside of the purging phase. Since the purging happens after the vmap_area is dismissed, its use is mutually exclusive with any use performed while the area is allocated. Signed-off-by: Igor Stoppa --- include/linux/vmalloc.h | 2 +- mm/vmalloc.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 1e5d8c392f15..2d07dfef3cfd 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -47,7 +47,7 @@ struct vmap_area { unsigned long flags; struct rb_node rb_node; /* address sorted rbtree */ struct list_head list; /* address sorted list */ - struct llist_node purge_list; /* "lazy purge" list */ + struct llist_node area_list; /* generic list of areas */ struct vm_struct *vm; struct rcu_head rcu_head; }; diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 61a1ca22b0f6..1bb2233bb262 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -682,7 +682,7 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end) lockdep_assert_held(&vmap_purge_lock); valist = llist_del_all(&vmap_purge_list); - llist_for_each_entry(va, valist, purge_list) { + llist_for_each_entry(va, valist, area_list) { if (va->va_start < start) start = va->va_start; if (va->va_end > end) @@ -696,7 +696,7 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end) flush_tlb_kernel_range(start, end); spin_lock(&vmap_area_lock); - llist_for_each_entry_safe(va, n_va, valist, purge_list) { + llist_for_each_entry_safe(va, n_va, valist, area_list) { int nr = (va->va_end - va->va_start) >> PAGE_SHIFT; __free_vmap_area(va); @@ -743,7 +743,7 @@ static void free_vmap_area_noflush(struct vmap_area *va) &vmap_lazy_nr); /* After this point, we may free va at any time */ - llist_add(&va->purge_list, &vmap_purge_list); + llist_add(&va->area_list, &vmap_purge_list); if (unlikely(nr_lazy > lazy_max_pages())) try_purge_vmap_area_lazy(); -- 2.14.1