Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp175349ybh; Tue, 17 Mar 2020 20:43:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv8SeTag0t+QHYEHFBJ2BpndnZ3PUZMcHeoHC3c0c9ILWeTsCzX7nxVlulVW15YO86RugNa X-Received: by 2002:a9d:1d43:: with SMTP id m61mr2181958otm.91.1584502996664; Tue, 17 Mar 2020 20:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584502996; cv=none; d=google.com; s=arc-20160816; b=A1qq4KtemNF0JP88pUsjxSm6KOVyjWEtwjBordEbNsRU+AHYaZTcAL6qlznDQnC4UH hjR0fo1i7J0fHEJH5+/pXU9UgZqPF3Jdcs+SOjBF2+ZcpJjTten6MrVXikhvB6Xl84dR fMi6zywwvKXt2vfp1HLm8tHIijP1TXnJTpeYNuXVtE5x0qTXG0xHlaQtPVAJEiAWvAZa ksWv7yg18pl9qtl3F0bJyCwgl4bPeo1YMKhGIVjLMV4A+KRsIqx2N12urZg2gIV72QGi zITMrYuQTiz/QrxSK55Ybmx+drwnPFwA7qSYKwJVHmTPApyTmAsFwfzjyYzL/IYtf1Sm YQig== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8H/ZgaxOVCaLlv2GrR9cTt1R1atml+Y0nsu1LssXxwQ=; b=KHC8/45nQNs+rcidIUDR9lUt2fTsQ4MJMXHABQEcFhua5BUmy1rJthm3a8r7XybX2m lvNrQma0B9bQoVNFaJk0B3GuAY9cW7A+aQI8sP6wpPjrDLjOCj/fK81P/cEoFs5XHf8s SCqhiRc83FxYyHl2xomc4sRJbtXbSYF41zJdlZw1vAbht3SUJa3qC2j7QfqbdeUKaWBg CTgFbukjApnCt47mE7o10VWR03Fz75glswQ26sqkH8Aok3+xFZ+jG/goeW6SOmXpceOG 2LzVqRh1JcCsVq+/HrFUOgJl/7I6gZDJGZA/vX3Ae9IbXuGpPNHpyYEiXUHgRtDOOvBx HgNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cdXdVxMp; 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 h3si2548189otm.254.2020.03.17.20.43.04; Tue, 17 Mar 2020 20:43: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cdXdVxMp; 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 S1726802AbgCRDm0 (ORCPT + 99 others); Tue, 17 Mar 2020 23:42:26 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:40673 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbgCRDmZ (ORCPT ); Tue, 17 Mar 2020 23:42:25 -0400 Received: by mail-qk1-f196.google.com with SMTP id j2so23662421qkl.7 for ; Tue, 17 Mar 2020 20:42:25 -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:content-transfer-encoding; bh=8H/ZgaxOVCaLlv2GrR9cTt1R1atml+Y0nsu1LssXxwQ=; b=cdXdVxMpdS2avuxbJfe5fumPGhUiiHxepZsYIgnQmJ+ST2hWiySC7uwzwvcbw/bKx9 RXEM5VIVIAru40XWZQpzspOEwIp3MUzCppzTpU7jPznQhoURhTsw6B52AaQIfjkI5KTJ bhF+vwHC/N55J6hj6fCgNv8nAXCT67g/lLRJPFgQW5h7zLVFE6Ko4mA2h7d9/isR3q7n VZVERe+xiAmXd6MKdvXm3oE1YST0CPxbHmwyVUeZTOfiDklbhe2MNzEFg3F+dhVWedwu Db5qp/YgOZW5sHwJBQeHU45TLOu9gr5TFmaacd4bK0h1u6L9Uhe9+zan+sNhGrgGnOHF y2wA== 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:content-transfer-encoding; bh=8H/ZgaxOVCaLlv2GrR9cTt1R1atml+Y0nsu1LssXxwQ=; b=bSsSUZ879LRJbEhgO3wRkJh1rY2fBvlJczvLkrWtjiSsMKnJ+8UyzVamWojG0K0INi VIA2L79CQD3fNvujIlx1YPZJvZnjdjiiigsenBbjTKSopbE5cO4b8wPgtOnwwQD6GkPh 6F95UACkTLCplGyDpx8txcaI3uZJ4tgiBRNdahUW3X52eckOaCcv+kN5QLpQki+E5i4k mX9q0slUM8V8znGsbxnjaqK5BMDWHbLiD/V+kYhUP1Vs9f6Kb1MLs3l1/6/2gjOCFUy6 UyPFiNovsZhQIdHevdiIRQkaYtP0SORQzIZaQgLR8sJGex/YlM4PjFQCxej0iwIJm5s4 BMgw== X-Gm-Message-State: ANhLgQ0YER+vj94pv5YKgCq8782xo7ZdIdr6LqJe7EebxHbDenMpoICL J1HEWTPsRU6fLv2kNdq/taCiQfT66ZO345g5ML8= X-Received: by 2002:a37:546:: with SMTP id 67mr2041350qkf.272.1584502944545; Tue, 17 Mar 2020 20:42:24 -0700 (PDT) MIME-Version: 1.0 References: <1584502378-12609-1-git-send-email-iamjoonsoo.kim@lge.com> <1584502378-12609-3-git-send-email-iamjoonsoo.kim@lge.com> In-Reply-To: <1584502378-12609-3-git-send-email-iamjoonsoo.kim@lge.com> From: Joonsoo Kim Date: Wed, 18 Mar 2020 12:42:13 +0900 Message-ID: Subject: Re: [PATCH v2 2/2] mm/page_alloc: integrate classzone_idx and high_zoneidx To: Andrew Morton Cc: Linux Memory Management List , LKML , Johannes Weiner , Michal Hocko , Minchan Kim , Vlastimil Babka , Mel Gorman , kernel-team@lge.com, Ye Xiaolong , Joonsoo Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2020=EB=85=84 3=EC=9B=94 18=EC=9D=BC (=EC=88=98) =EC=98=A4=ED=9B=84 12:33, = =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > From: Joonsoo Kim > > classzone_idx is just different name for high_zoneidx now. > So, integrate them and add some comment to struct alloc_context > in order to reduce future confusion about the meaning of this variable. > > In addition to integration, this patch also renames high_zoneidx > to highest_zoneidx since it represents more precise meaning. > > Signed-off-by: Joonsoo Kim > --- > include/linux/compaction.h | 9 ++-- > include/linux/mmzone.h | 12 ++--- > include/trace/events/compaction.h | 22 ++++---- > include/trace/events/vmscan.h | 14 +++-- > mm/compaction.c | 64 +++++++++++------------ > mm/internal.h | 10 ++-- > mm/memory_hotplug.c | 6 +-- > mm/oom_kill.c | 4 +- > mm/page_alloc.c | 60 +++++++++++----------- > mm/slab.c | 4 +- > mm/slub.c | 4 +- > mm/vmscan.c | 105 ++++++++++++++++++++------------= ------ > 12 files changed, 165 insertions(+), 149 deletions(-) Oops... I miss the important part that documents highest_zoneidx. Please see below. Thanks. ------------------>8------------------ diff --git a/mm/internal.h b/mm/internal.h index 7921150..4bbd10fc 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -115,6 +115,17 @@ struct alloc_context { nodemask_t *nodemask; struct zoneref *preferred_zoneref; int migratetype; + + /* + * highest_zoneidx represents highest usable zone index of + * the allocation request. Due to the nature of the zone, + * memory on lower zone than the highest_zoneidx will be + * protected by lowmem_reserve[highest_zoneidx]. + * + * highest_zoneidx is also used by reclaim/compaction to limit + * the target zone since higher zone than this index cannot be + * usable for this allocation request. + */ enum zone_type highest_zoneidx; bool spread_dirty_pages; };