Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3407955ybi; Tue, 2 Jul 2019 07:16:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1Wf/hWTsD6+ExlXA2J0QsWI2m1zHN3/lh28MohoinNu9aacsOfZuJNENETXgtrJNAOQEk X-Received: by 2002:a17:90a:23ce:: with SMTP id g72mr5925465pje.77.1562077005792; Tue, 02 Jul 2019 07:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562077005; cv=none; d=google.com; s=arc-20160816; b=L+RMCppNxe7VtnSZsf2pVrpyXeXejlXQa9J9GUhAK2AXEEtFL0O/gRRsMLkwqgFeAB /0Nsvxf/2ZvRPex8zppH1X//CWbPYUOGW8AdBWTaQ+rPlOVMc6455GKJQXuz8VahBPKR aMC0xQ3CBrycX8rQR4iglOXoZBKpnKwmJ9M8RDVTF5NBxC6GF53Ab1XqEAsGKi6gHArt GWqx5Tr/2D0ZtEbmWYmCSvB+gfLEXBQYMmTIgxATGoGGJu1455UGSAUaSS+7IaYhvouB kZv60RtEOETVuu1G4kRQsbkdxkXoYqxjlQrdb9r3+xTN5QZhFJhTIF8aDa6F9S1U/33C tLdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=G8tirXskpMAhNy3e7NClMztjS4SZXfLYl5ZSuLbR4Hk=; b=oreA5HrYfg8tXeungTs0WRoYeeYv84ZsinFJKqyMldiCX4o44D6PRd8euLj9IkH3E3 S/7/R5HujuM9qSiJhHmG9UTdmsSg6JBLyDUtRrE3EoYL099zzBXjUuOXOSWWI4CdTfBi WjyJubn2US3rj7H3wpNic9i9WIw+QR6ukS4sAFyfNhK9QwDYVx76e0k9ZNCvKSPOaS6U YSvztCKS+viixpyZWYA6i7Ex1BhHerP7LPhT8rWmqzzaR3kPD3igXKQCWiyBd/OQENR1 kPCt614APPGbLt2MGfw+UY2cYrjUPOWRZa161JJLGXfNBAYCEI770xaNzJgGnGxymiM5 5Dlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bFSlFbov; 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 j9si12320117pgp.328.2019.07.02.07.16.30; Tue, 02 Jul 2019 07:16:45 -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=bFSlFbov; 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 S1726825AbfGBOQB (ORCPT + 99 others); Tue, 2 Jul 2019 10:16:01 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:47012 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbfGBOQB (ORCPT ); Tue, 2 Jul 2019 10:16:01 -0400 Received: by mail-pl1-f196.google.com with SMTP id e5so436633pls.13 for ; Tue, 02 Jul 2019 07:16:01 -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:mime-version :content-transfer-encoding; bh=G8tirXskpMAhNy3e7NClMztjS4SZXfLYl5ZSuLbR4Hk=; b=bFSlFbov+AMUg7OyusaEXkDzPAaG9WIl2+j01Ib4t9nVU2vyX3V5Suc1jxvh0DMj4T osRX55sJ9hfdqs/H2DsXotlaYgrJsTPTosbqaFjZ5Ny7OB/oA1xRiN0mYKeLefCNUYP1 WWAcMJ0NsOy+TwuofxTX+Y/wOx+q3P9evixECNzjly7tNVKK2hyZj6BeUQC8pkFgeI+1 hsDXQJzau9+X19hrIKQuBv1or+rC7V/lFvHmy3SlA89akP4tMFNmfn07X+mkdDAFiKwx uXtGxoLd6Vjcdocc4x7bqBR8dvoBfmATuNlWtlqxVDvpR8VTTIRwE1atqvT/NAFkaqu5 uCGg== 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:mime-version :content-transfer-encoding; bh=G8tirXskpMAhNy3e7NClMztjS4SZXfLYl5ZSuLbR4Hk=; b=qk4SKnAyf3gTDqIPX5tgakeebhpKkcMhLCW5KP8thtqhlNXqGThRqkODPABrLhNnJ0 sTAryOEPmVHlMOvJKKAiWlL2wEY88KGFXA84mrYm061KACoF2Rayoz10AoY1iv3c3BUE gtnJ+xeROUSBcRRI7t6nOY1V838Yp5i3+VdpXCqO827WsGR31Q1Uqi2b4r8QVg1hTWY4 ThjQvygoWWMq+Xq9SeCbGhhSf2Eu4WzKA/tB9di89GnCyRcC0zHfTSubi+28SSWhQAuW 1QGR60GqEs/+DCZwC5lp21OHOfoO3d1DiVoT8jnFnuUN6u4VPsAJTAWvAgtyBvhZj2Zq ZHbg== X-Gm-Message-State: APjAAAXrNQeeJKloeOH1aJ2g6OsShv+zjnzD4ItmhRYjXV7nWi671/ac ODC08LMC4WjY72AyjVwaKLM= X-Received: by 2002:a17:902:b688:: with SMTP id c8mr35129791pls.243.1562076960851; Tue, 02 Jul 2019 07:16:00 -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.15.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 07:16:00 -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 0/5] mm/vmalloc.c: improve readability and rewrite vmap_area Date: Tue, 2 Jul 2019 22:15:36 +0800 Message-Id: <20190702141541.12635-1-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v1 -> v2: * patch 3: Rename __find_vmap_area to __search_va_in_busy_tree instead of __search_va_from_busy_tree. * patch 5: Add motivation and necessary test data to the commit message. * patch 5: Let va->flags use only some low bits of va_start instead of completely overwriting va_start. 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. Pengfei Li (5): mm/vmalloc.c: Introduce a wrapper function of insert_vmap_area() mm/vmalloc.c: Introduce a wrapper function of insert_vmap_area_augment() mm/vmalloc.c: Rename function __find_vmap_area() for readability mm/vmalloc.c: Modify function merge_or_add_vmap_area() for readability mm/vmalloc.c: Rewrite struct vmap_area to reduce its size include/linux/vmalloc.h | 28 +++++--- mm/vmalloc.c | 139 ++++++++++++++++++++++++++++------------ 2 files changed, 118 insertions(+), 49 deletions(-) -- 2.21.0