From patchwork Tue Jun 7 10:59:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12871721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CC6AC43334 for ; Tue, 7 Jun 2022 11:00:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D02586B0078; Tue, 7 Jun 2022 07:00:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB2426B007B; Tue, 7 Jun 2022 07:00:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7A156B007D; Tue, 7 Jun 2022 07:00:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AB4CB6B0078 for ; Tue, 7 Jun 2022 07:00:25 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 7BCF180EBC for ; Tue, 7 Jun 2022 11:00:25 +0000 (UTC) X-FDA: 79551146010.23.705AC25 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id D452A14007B for ; Tue, 7 Jun 2022 11:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654599624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VzaXOhmAYBhkuCm+bqJjmltdmOzIulpuJDII2ewUdDA=; b=Xvz3oR20AMQtSPRDuH9ZQ+yRyJOGH0yhifMOYdjnNFp1UUQ69DD/2sAqQ86nydOh8uBpOV nrcMNYaE3I+9zWfmoN2A9kJ4f0tc2rTrrSwKilbGNF2Lz0GReGpwe3EIaW+H6LrBuEpMTh u/sMjYzl7ZAvQkwjLfy+AgD6xqu6pBk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-367-eG3V-dzYOMehpD-rOWm9pw-1; Tue, 07 Jun 2022 07:00:21 -0400 X-MC-Unique: eG3V-dzYOMehpD-rOWm9pw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC505380114F; Tue, 7 Jun 2022 11:00:20 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-113.pek2.redhat.com [10.72.13.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B2391121314; Tue, 7 Jun 2022 11:00:16 +0000 (UTC) From: Baoquan He To: akpm@linux-foundation.org, urezki@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, hch@infradead.org, Baoquan He Subject: [PATCH v2 4/4] mm/vmalloc: Add code comment for find_vmap_area_exceed_addr() Date: Tue, 7 Jun 2022 18:59:58 +0800 Message-Id: <20220607105958.382076-5-bhe@redhat.com> In-Reply-To: <20220607105958.382076-1-bhe@redhat.com> References: <20220607105958.382076-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Xvz3oR20; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf09.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com X-Stat-Signature: zxt6z1zhmunwni11ei6ge534imkekku5 X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D452A14007B X-HE-Tag: 1654599607-647246 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: Its behaviour is like find_vma() which finds an area above the specified address, add comment to make it easier to understand. And also fix two places of grammer mistake/typo. Signed-off-by: Baoquan He Reviewed-by: Uladzislau Rezki (Sony) --- mm/vmalloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index b9bf7dfe71ec..a4d8b80734fa 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -790,6 +790,7 @@ unsigned long vmalloc_nr_pages(void) return atomic_long_read(&nr_vmalloc_pages); } +/* Look up the first VA which satisfies addr < va_end, NULL if none. */ static struct vmap_area *find_vmap_area_exceed_addr(unsigned long addr) { struct vmap_area *va = NULL; @@ -929,7 +930,7 @@ link_va(struct vmap_area *va, struct rb_root *root, * Some explanation here. Just perform simple insertion * to the tree. We do not set va->subtree_max_size to * its current size before calling rb_insert_augmented(). - * It is because of we populate the tree from the bottom + * It is because we populate the tree from the bottom * to parent levels when the node _is_ in the tree. * * Therefore we set subtree_max_size to zero after insertion, @@ -1655,7 +1656,7 @@ static atomic_long_t vmap_lazy_nr = ATOMIC_LONG_INIT(0); /* * Serialize vmap purging. There is no actual critical section protected - * by this look, but we want to avoid concurrent calls for performance + * by this lock, but we want to avoid concurrent calls for performance * reasons and to make the pcpu_get_vm_areas more deterministic. */ static DEFINE_MUTEX(vmap_purge_lock);