Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1007937ybi; Fri, 12 Jul 2019 08:09:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTHrQ3TlcjPXTyq5DjUsyIpCGjCyFS24Akkmx2B85d9jXACU+goerxFoETATkiRZlKSwXG X-Received: by 2002:a17:902:1e6:: with SMTP id b93mr11947333plb.295.1562944187156; Fri, 12 Jul 2019 08:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562944187; cv=none; d=google.com; s=arc-20160816; b=F5XbiX1IbQJECK3O7llAlyy9PsAo2LoLEn2IunbniiREWVSPphbnJppVTjW63udy6e H6cdWz5VQTEnZvqokoyTa9uBGDIYGv0SvvtYvmvpfhNemHiYgQR8o4cf0vvjk5Cc0UkS D9RUReJ88gf88d8eTADBFOnSckiV03WIMrPAkYM3f91FGDSSAW/sd3WXF1D6ZwCIhgJ0 Vw5hNPPCxz1xvYHjDTytI6QbLHRLrMGM0YGZGrGjrZiCCWXRovQgy2lCCIIU+n/NpEvG kbKcmG+cNg2LXCGecIVmFlPVGG2u/esVbpHqduSPdLazE9+nc0EGtlP52G9MjEm8kxJ5 pqcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MJ8/wMSygZBfB3wNzWuYzcvp2/BWwETDvXU2IK3PdxQ=; b=TCI7mZMA4KRG/hlgPvQHLlQc2gTFqn9llRc77/GPlMD09h4uf5yfgdyZDAZBDExJI6 stk10SE/dun3dzm7RlYWx0jt6UFsvvhyYqF502hd1cuK4yK4SQM7C3nOGAfDFPYnWTft lFVo1pfvyBNY9RZaIXYst+PT/HLy6IGaZYsz96TkIvH8DO7Ke4IMNAdb6Ikcrp7rF+s3 LWppiqEON//q/v3i6kfEd90B4/v0aQRgpLOLI76VJQMUhR3wyo5MPqglZewmxhMh+xq0 MO6HJ+D3KUy4UhSGOKKyiCnsQlkqq55fpqMY0noj8lTS7j+zZiddouv2lwRJuvJZD45H zIbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i30lgvwL; 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 w16si9267044pfq.70.2019.07.12.08.09.30; Fri, 12 Jul 2019 08:09:47 -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=i30lgvwL; 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 S1727019AbfGLPJN (ORCPT + 99 others); Fri, 12 Jul 2019 11:09:13 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:35772 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726318AbfGLPJM (ORCPT ); Fri, 12 Jul 2019 11:09:12 -0400 Received: by mail-oi1-f195.google.com with SMTP id a127so7526296oii.2 for ; Fri, 12 Jul 2019 08:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MJ8/wMSygZBfB3wNzWuYzcvp2/BWwETDvXU2IK3PdxQ=; b=i30lgvwLkeVpXQsVjPYonpEPiGWlUBv2z2qDgJQMxrpKENxTorJSehxeqy+LUhfYzv VtQK7axqN3W8U1LkXDuWZF1uP/L2p5KuLxKw4qI6wW++8B5fsIOnjjNBcW6teOiQ7tII mzaCC2ZUY+uYaRDsXXA4s9KcaDlBUAOOWLZdYfvJUEAQEBDrP1cVZ7aiVZqE4JPjLspM gGX5Sxlw25a4BwETR5XcKtZkSZrIlIkMg/I5T2vbeOKWQ6GxTtCPuP3CCKEjJvhuAnNI gUc8VfcZTZNpYUjORWUUYKbazILP48oH1baF5oAlWmAp2Iq73gk63PjeR6tPL6TgX/5n EdVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MJ8/wMSygZBfB3wNzWuYzcvp2/BWwETDvXU2IK3PdxQ=; b=pmO/InhCSjoSmH2w/HL68DRYlAR71Qso8YU+l1+bNzLI/1Ml2WwiKLMu3kIvcNlxOo gR/D7fYz3EvBQ4iehjPmBwt9vC0V4Z8wNwjRpBZ/nQzah2rzfkFGwb8YXn4GJ3pjsGxB 7QUnBGax79Ham6WiqXmBmpqt27hizYmPP54AxWE1JihRHPlEmaLrN/tO5NBa2SdiaJkQ H7oTwxdEYqHFoXrQ0XQi5OcRvn4Ag0DQ8WIM4BjHUz2fwGcLmIXIMZi3x0BPJpgbvPG6 xQstEB/HFICY+4hZ21g/LK84NpyhSKfIsx4PwiRZAIf7TX/UJQuhT7nllUt3Pz8TzbND +kbA== X-Gm-Message-State: APjAAAWUn6hNtoVDMfZ9aoNNnMHuK4vb2YAyQQjotAfGk0VhC/RVGL35 NCW7IuTCzFvmpP0VKwKVL6Mb4YrUu8VQM5YMpMNdinImxmQjiA== X-Received: by 2002:a05:6808:4d:: with SMTP id v13mr6048794oic.22.1562944151822; Fri, 12 Jul 2019 08:09:11 -0700 (PDT) MIME-Version: 1.0 References: <20190712120213.2825-1-lpf.vector@gmail.com> <20190712120213.2825-3-lpf.vector@gmail.com> <20190712134955.GV32320@bombadil.infradead.org> In-Reply-To: <20190712134955.GV32320@bombadil.infradead.org> From: Pengfei Li Date: Fri, 12 Jul 2019 23:09:00 +0800 Message-ID: Subject: Re: [PATCH v4 2/2] mm/vmalloc.c: Modify struct vmap_area to reduce its size To: Matthew Wilcox Cc: Andrew Morton , Uladzislau Rezki , rpenyaev@suse.de, peterz@infradead.org, guro@fb.com, rick.p.edgecombe@intel.com, rppt@linux.ibm.com, aryabinin@virtuozzo.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 12, 2019 at 9:49 PM Matthew Wilcox wrote: > > On Fri, Jul 12, 2019 at 08:02:13PM +0800, Pengfei Li wrote: > > I don't think you need struct union struct union. Because llist_node > is just a pointer, you can get the same savings with just: > > union { > struct llist_node purge_list; > struct vm_struct *vm; > unsigned long subtree_max_size; > }; > Thanks for your comments. As you said, I did this in v3. https://patchwork.kernel.org/patch/11031507/ The reason why I use struct union struct in v4 is that I want to express "in the tree" and "in the purge list" are two completely isolated cases. struct vmap_area { union { struct { /* Case A: In the tree */ ... }; struct { /* Case B: In the purge list */ ... }; }; }; The "rb_node" and "list" should also not be used when va is in the purge list what do you think of this idea?