From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 202B4C28CBC for ; Mon, 4 May 2020 03:10:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CD69B20643 for ; Mon, 4 May 2020 03:10:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JxO6t7Oi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD69B20643 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6BECD8E0006; Sun, 3 May 2020 23:10:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 647E68E0001; Sun, 3 May 2020 23:10:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 536C28E0006; Sun, 3 May 2020 23:10:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0154.hostedemail.com [216.40.44.154]) by kanga.kvack.org (Postfix) with ESMTP id 3C5018E0001 for ; Sun, 3 May 2020 23:10:48 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F3ED4180AD80F for ; Mon, 4 May 2020 03:10:47 +0000 (UTC) X-FDA: 76777559334.20.horse75_7b59a075d2c62 X-HE-Tag: horse75_7b59a075d2c62 X-Filterd-Recvd-Size: 6177 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 May 2020 03:10:47 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id z90so12878768qtd.10 for ; Sun, 03 May 2020 20:10:47 -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=djdavoQlcMLn5fwkocDKSySG9/s4rpsKXrcEkGBqZtM=; b=JxO6t7OiVJ9V+sTQLoAhyesCPGBIuVvDmmYlLKr3sdHIf8eMOh33WbSn4oSpSxe9kt DkGQ47zPKxiLN/kcbUmS6XQubKDGI+aK2+byzYZ+urMwyraSqFKqOZvW9biaFuGG9TkI PERI5mzAX92ADFzn3vFY1/Fk4ikYInzKveDmYqdVLdgiE2hCvPmB65FTB/pm3B9mH5oh DQTGZyokcz7dtCQZOFNKwYvmK3jDC9AWYDht3LqKDobIK2kAiIDev0gy+apZvilxHd+B nuBm+cQoJZ1TmX5xi1B7drJN5XSW7AHtNteAGvA4BpDIH1BsocQ8uM+Ps9XfkeWxotL3 yQyg== 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=djdavoQlcMLn5fwkocDKSySG9/s4rpsKXrcEkGBqZtM=; b=PH2/CZF0kLTq3LoZGDsentO1ngAZ9HTpr8A61XVZN98HGbN5/fP+u577DDH0OVxPJ5 KQ4b3kL7M86DYM8EKZgBLN2s+O9k2zcKjaaQRo9I6OtVv+1hakhKL5MznO+J62RE+LP2 FCOxttflAJe1HdMBX7FSjKMJBkEY78fb0Bw0FwYTPPrm0sJRduQvYmvdlr4e1W0C0U2n rcQitIB5Pb4d1DWgdHtOp/K5Zg1g5L9IBGx8MuCHX1OrKXgmYARBh1Q9D3SnjK8Qtto4 c2aLSMo8PxKbh7N6O7onLWa28bAxJaLbt6zXpIgn8fspN5GLDGAeWWqbg1G1D1HFWcQy E40w== X-Gm-Message-State: AGi0PuYDI3fcOWcDndyb+znR4GwAnUGFeXINiggRlszEZMb/QNN1u19V u9b/ZOFc0RzUuysh9S9xMbByv3yqs7Zs+p/nO+E= X-Google-Smtp-Source: APiQypII5oOpAZnu/kUOCT9v27QOYf/JDwOsDN8bjeVxSk9v0jhihGUsVnH4lMddwFnO48fu/WRr97gOyTuhWfXtY4w= X-Received: by 2002:ac8:2a70:: with SMTP id l45mr15345878qtl.232.1588561846918; Sun, 03 May 2020 20:10:46 -0700 (PDT) MIME-Version: 1.0 References: <1588130803-20527-1-git-send-email-iamjoonsoo.kim@lge.com> <1588130803-20527-4-git-send-email-iamjoonsoo.kim@lge.com> <87h7wzvjko.fsf@x220.int.ebiederm.org> In-Reply-To: <87h7wzvjko.fsf@x220.int.ebiederm.org> From: Joonsoo Kim Date: Mon, 4 May 2020 12:10:36 +0900 Message-ID: Subject: Re: [PATCH v2 03/10] kexec: separate PageHighMem() and PageHighMemZone() use case To: "Eric W. Biederman" Cc: Andrew Morton , Linux Memory Management List , LKML , Vlastimil Babka , Laura Abbott , "Aneesh Kumar K . V" , Mel Gorman , Michal Hocko , Johannes Weiner , Roman Gushchin , Minchan Kim , Rik van Riel , Christian Koenig , Huang Rui , "Rafael J . Wysocki" , Pavel Machek , kernel-team@lge.com, Christoph Hellwig , Joonsoo Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: 2020=EB=85=84 5=EC=9B=94 1=EC=9D=BC (=EA=B8=88) =EC=98=A4=ED=9B=84 11:06, E= ric W. Biederman =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84= =B1: > > js1304@gmail.com writes: > > > From: Joonsoo Kim > > > > Until now, PageHighMem() is used for two different cases. One is to che= ck > > if there is a direct mapping for this page or not. The other is to chec= k > > the zone of this page, that is, weather it is the highmem type zone or = not. > > > > Now, we have separate functions, PageHighMem() and PageHighMemZone() fo= r > > each cases. Use appropriate one. > > > > Note that there are some rules to determine the proper macro. > > > > 1. If PageHighMem() is called for checking if the direct mapping exists > > or not, use PageHighMem(). > > 2. If PageHighMem() is used to predict the previous gfp_flags for > > this page, use PageHighMemZone(). The zone of the page is related to > > the gfp_flags. > > 3. If purpose of calling PageHighMem() is to count highmem page and > > to interact with the system by using this count, use PageHighMemZone(). > > This counter is usually used to calculate the available memory for an > > kernel allocation and pages on the highmem zone cannot be available > > for an kernel allocation. > > 4. Otherwise, use PageHighMemZone(). It's safe since it's implementatio= n > > is just copy of the previous PageHighMem() implementation and won't > > be changed. > > > > I apply the rule #2 for this patch. > > Hmm. > > What happened to the notion of deprecating and reducing the usage of > highmem? I know that we have some embedded architectures where it is > still important but this feels like it flies in the face of that. AFAIK, deprecating highmem requires some more time and, before then, we need to support it. > > This part of kexec would be much more maintainable if it had a proper > mm layer helper that tested to see if the page matched the passed in > gfp flags. That way the mm layer could keep changing and doing weird > gyrations and this code would not care. Good idea! I will do it. > > What would be really helpful is if there was a straight forward way to > allocate memory whose physical address fits in the native word size. > > > All I know for certain about this patch is that it takes a piece of code > that looked like it made sense, and transfroms it into something I can > not easily verify, and can not maintain. Although I decide to make a helper as you described above, I don't understand why you think that a new code isn't maintainable. It is just the same thing with different name. Could you elaborate more why do you think so? Thanks.