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=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 89502C2BA19 for ; Tue, 21 Apr 2020 06:49:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 47FEA2072D for ; Tue, 21 Apr 2020 06:49:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XHr4v8ub" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47FEA2072D 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 CE1F28E0005; Tue, 21 Apr 2020 02:49:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C92458E0003; Tue, 21 Apr 2020 02:49:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA8718E0005; Tue, 21 Apr 2020 02:49:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id A251C8E0003 for ; Tue, 21 Apr 2020 02:49:27 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5F9492491 for ; Tue, 21 Apr 2020 06:49:27 +0000 (UTC) X-FDA: 76730935974.18.bite44_6fa037240f549 X-HE-Tag: bite44_6fa037240f549 X-Filterd-Recvd-Size: 5267 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Apr 2020 06:49:26 +0000 (UTC) Received: by mail-qv1-f49.google.com with SMTP id t8so4093664qvw.5 for ; Mon, 20 Apr 2020 23:49:26 -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=5YbLsKCYzHJjqZKHmOzPYxnR4/ybuDNs41jdJOZ0kcU=; b=XHr4v8ubQCubJxaztTveYKxTL+o7Ta5nt4OaycGIwPfKXXI4ptAonw/22gL6+zw5zd KkE9TY5h8EdhoHD3KrFiL3/mf4C47QbpjtEVOZVeRt1i1EGLvsD3icnFqoq8k69j91GB ymvwYnbcVTe7ynIMbQL8l5p5hxX3P+5sj1PI+XfEzlZGXN2OSqFGeXUg4OOLC8Qg2Vqz c9o8DLefGPXOmjXqCscilG1hQafxMxxTp7zixJagkNfyDCRgTKPxy/qKzR1xI9gMjnx7 LKaMxzyDrP4PMgK4pcUBfs0oYQf9ap9zKwlIec7Y+ZCJcq17fTnjIzSm9n+a9MEFsNbY 1btg== 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=5YbLsKCYzHJjqZKHmOzPYxnR4/ybuDNs41jdJOZ0kcU=; b=Ocxv9jVfvtMN7E1OoIXO0KKK2vJaaTAxdv5aYtFlSKLtf5w4LMGw42+UqpDXP7nsgG urWCFLAq8vMaI3Py+AtnjP+/S04fXqaELH6Z9hll/YFQPu2txKKkiHPWQLuP7ubkG6wq 47oJ/WxDNsM+3fd8/pB0h/qp7ewfPdsVV+VYuzCffVhnNS41K3vtnb0nQQq2IgkWyasm 79Y55sAvkR32h7JRBotjBfYjGOHzXutDDmNjWXI0mBa1FBYO3sKrsfvxk2SkyACoIuNW X3Dhrr853C6cZWfdJq1xXSEutw54OLcBlImCxZcog7OKbTSmglQ3fDPbYnvnWcePn+nU /0gA== X-Gm-Message-State: AGi0PuaG0po7bXVPLdljDRp/zeEGcH00Yaay0ARERBxWLlA0Gzk3+dV2 vmlg9QLflhzJIzrn08T7zVJB3krZujhLHL3sm8Q= X-Google-Smtp-Source: APiQypIqzLG4pTe/AdivZMhQC8Rg52W6xtI+TVlru4ziYt0FnHQtpUnN4nvGg3la4v/AC4bTEDYIBU7Wif9fu2ktKaM= X-Received: by 2002:a05:6214:1248:: with SMTP id q8mr18877300qvv.66.1587451766306; Mon, 20 Apr 2020 23:49:26 -0700 (PDT) MIME-Version: 1.0 References: <1587369582-3882-1-git-send-email-iamjoonsoo.kim@lge.com> <1587369582-3882-3-git-send-email-iamjoonsoo.kim@lge.com> <412ea2bd-1719-c086-b3e7-64eec6e2bdc4@amd.com> In-Reply-To: <412ea2bd-1719-c086-b3e7-64eec6e2bdc4@amd.com> From: Joonsoo Kim Date: Tue, 21 Apr 2020 15:49:15 +0900 Message-ID: Subject: Re: [PATCH 02/10] drm/ttm: separate PageHighMem() and PageHighMemZone() use case To: =?UTF-8?Q?Christian_K=C3=B6nig?= 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 , Huang Rui , Eric Biederman , "Rafael J . Wysocki" , Pavel Machek , 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 4=EC=9B=94 20=EC=9D=BC (=EC=9B=94) =EC=98=A4=ED=9B=84 5:42, C= hristian K=C3=B6nig =EB=8B=98=EC=9D=B4 =EC=9E=91= =EC=84=B1: > > Am 20.04.20 um 09:59 schrieb js1304@gmail.com: > > 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 #4 for this patch. > > > > Signed-off-by: Joonsoo Kim > > Reviewed-by: Christian K=C3=B6nig for the TTM > changes, but I can't judge if the general approach makes sense or not. Thanks for review! General approach needs to get an agreement from more developers. Thanks.