Received: by 10.192.165.148 with SMTP id m20csp3394447imm; Mon, 23 Apr 2018 05:59:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx496vJ9pmQU19XY5HlS3MKgtZHNrPLAozJEs67s+gq31lGI3QC6oCs+O5yz2Pmpyp14+HqjY X-Received: by 10.98.93.153 with SMTP id n25mr11248295pfj.143.1524488350647; Mon, 23 Apr 2018 05:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524488350; cv=none; d=google.com; s=arc-20160816; b=qvj9HY8zt8JjIsP3h6EDjDSMjoYGeNheH3zItLaw/x/nVtPGhiSY+MP8YoltqJqyMe x7FapvyeNhLswUpfBd1uDWn2o9Xyv53OgcJdsc72Ky1Zx5d031yF3ZDcuZRP/kNBHK96 O7ssHpJUo0H9jaY6dqxHmVUsBNsc6S99vPEP2ye9JpcYsmBuo6LIbXreiDgF5jb8y3rW eGdioGDTVLG45AfI3UcYAEQu/cVQwfQoDeuTu8/UlrYAIJU5SzRt3NuxLXC8G/OSsg1/ ICSc3ZtwqDvogvfcAMUiMNV5Ng6M+IpeMFxkZQSCiyIgXvA4zquJqo0BarHVDB+4w4yV TKhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=OYIHO1E2FYttMwneu+ZKZ5RJfEzIKDHgu84G5IWf0uw=; b=e6F7yZ1dxvT9BZrD7RV4LdeCjuyvqSh8VdsG3TA3UcjdsspQ5q8ZszQ1OYc6GuR2aN 2msYoJBNjwdRLSXCakeDoju/mQbpzp8n0cvverf6R1tyAFQVEpSkf8I0agwYJcDUxKAW KbNzSQ+enXFMzpsyZK/Pws1sE6TpglKTvxmU1nTGNaUMp3Q+MTy1/Hp4FHSBS3JgLdaF HjQO8w8v+fRSW3Kw0AamOXK7z+xAJpUxuA+phMX/fe7dC+DZCdMnME0n9Z4Sjp6Uwq4D egWrHi+p2s6FWExnsJ445CzUt5RbyoYcPhW2VHGIUStrPiHaOg8qCWF2FEvLPxMoy+sM nQjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bZQvmXOv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a68-v6si6405175pli.158.2018.04.23.05.58.56; Mon, 23 Apr 2018 05:59:10 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bZQvmXOv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755344AbeDWM5W (ORCPT + 99 others); Mon, 23 Apr 2018 08:57:22 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:45424 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755214AbeDWMza (ORCPT ); Mon, 23 Apr 2018 08:55:30 -0400 Received: by mail-io0-f195.google.com with SMTP id r22-v6so9232330ioc.12; Mon, 23 Apr 2018 05:55:29 -0700 (PDT) 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; bh=OYIHO1E2FYttMwneu+ZKZ5RJfEzIKDHgu84G5IWf0uw=; b=bZQvmXOvr2/a36uCnOTZdnMSg+em+CnJG0MwKfmUvtURQa/08SONbk2wyR+iV+IwzO EYgBOKFkDqUc1DcPzqNEzM7rzfsqxTqKM1AOAowZAqmHwuykjKuA19U5F+n9RPsYohm0 02ti02iWmCiClCsGueR89FCR4JF0dr7e8xPsN2Oo2IvCPHl0Zv4z9LRrClpOX8SaPFfA /UaOZ6wujTMUR6BhF8jXYmsHYFTcGFkvin7nc77LJoZLkULRqj12GXhuaGq896dkWH9j o9VlfQW3WA/EWIupFJHozFA3Klxo8Hvl8HLBnb3oObFkkJAI7ivicSIw5UmMqo8FgkYy e+Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OYIHO1E2FYttMwneu+ZKZ5RJfEzIKDHgu84G5IWf0uw=; b=piJDkC0AI3K33Jq2fs3oaOGhrErWWxz1FWwmaV97lae4VCPb6HMSWS2j/cR8QkMLRW /MqzU5izbdX2/WdMSgvhFI8y9vS5NLlvNRymEOZnFNyrLOg6RlFuZ6NmF4DUjCnhrXuJ iazVzl5HMQJ3Gm9kzqjV4WJZXCBZjIyDMXDUd/SUJos2sbad1Ur7PT8JgfKayZUZChAV cPUUhUNY/NE1btPibffb6EpnghtndFu7PfRDRpE+bZGovpMcf5dqi9u8DqxMDZnuCriN 25MrOCT0fP4KoZxExy63GWEGGlJFGD/qtY8HLJ5Qxfwdv6OGY61hPWsI+CItWhh+9hKi L1lw== X-Gm-Message-State: ALQs6tAW7cHRuAh1DDB+FMZ2y0Z5FR326ikNwEdpM3HgJsaKu02Lla7Y uhPFEewlJAPuQ7+oTwnh4G4= X-Received: by 2002:a6b:a292:: with SMTP id l140-v6mr21118695ioe.39.1524488129109; Mon, 23 Apr 2018 05:55:29 -0700 (PDT) Received: from Mort.huawei.com (174-23-152-165.slkc.qwest.net. [174.23.152.165]) by smtp.gmail.com with ESMTPSA id n67-v6sm5934417ioe.20.2018.04.23.05.55.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 05:55:28 -0700 (PDT) From: Igor Stoppa X-Google-Original-From: Igor Stoppa To: willy@infradead.org, keescook@chromium.org, paul@paul-moore.com, sds@tycho.nsa.gov, mhocko@kernel.org, corbet@lwn.net Cc: labbott@redhat.com, linux-cc=david@fromorbit.com, --cc=rppt@linux.vnet.ibm.com, --security-module@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, igor.stoppa@gmail.com, Igor Stoppa Subject: [PATCH 2/9] vmalloc: rename llist field in vmap_area Date: Mon, 23 Apr 2018 16:54:51 +0400 Message-Id: <20180423125458.5338-3-igor.stoppa@huawei.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180423125458.5338-1-igor.stoppa@huawei.com> References: <20180423125458.5338-1-igor.stoppa@huawei.com> 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