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 3E1E7C433E0 for ; Mon, 1 Jun 2020 06:40:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C6C8E206C3 for ; Mon, 1 Jun 2020 06:40:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uC26ZjQZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6C8E206C3 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 271D9280001; Mon, 1 Jun 2020 02:40:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 223338E0003; Mon, 1 Jun 2020 02:40:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 112AA280001; Mon, 1 Jun 2020 02:40:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0071.hostedemail.com [216.40.44.71]) by kanga.kvack.org (Postfix) with ESMTP id E96E88E0003 for ; Mon, 1 Jun 2020 02:40:06 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8D1AC180AD802 for ; Mon, 1 Jun 2020 06:40:06 +0000 (UTC) X-FDA: 76879693212.10.use89_58356280ee727 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 72C5C16A0AB for ; Mon, 1 Jun 2020 06:40:06 +0000 (UTC) X-HE-Tag: use89_58356280ee727 X-Filterd-Recvd-Size: 5852 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Mon, 1 Jun 2020 06:40:06 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id u17so5791250qtq.1 for ; Sun, 31 May 2020 23:40:05 -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=oL022P9vCPxNbqvST58uSq8Z98BV5spczkI6DhdRhmA=; b=uC26ZjQZe9xJXF99/nrXwhOxZ0/BKVZ5jbouogDnEgb0Yj8sw1pDQUFZ384ClSYGa8 xFNCsYt6fkjG7gtL3rhaFr+wuVGEOJMl3HcIP7KUuvRaWk+BCvpo6mmRHFQT4RcSF68f HG2IeZaFdLXpovtc3Pb2xvs+wsNFJCJaGX3bhM6Z4ByiAfUjs4J/H+RDi02VClyluJUV qJXaoSdyhXcH9U1xWjInzFP8OHW9FU3eLfzhZEjz7ybUmH9wGWhfeB1Ruth3zZwEpJTz sc8EYypgCQdq9+qqgjrJiiWwFMYVxvva/d9+WO7o0dI/B4uv/DsDWLJ8UoNkWbvNs/M6 Y6lg== 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=oL022P9vCPxNbqvST58uSq8Z98BV5spczkI6DhdRhmA=; b=GV50Z901+J7ZwRDy9b+8NnV1PySJdn4XEC3uijGmh6qPVHttxGk8HzptuXnfdr6Q90 u9tEEPBfXembEhRXHJFnpDwd1Dil7q8v7lRXae5fAwZXnq1cXXxz8TRmZRdISqCp8xmJ QBWh7/wUm+KeKB5Y8Og+jjMxVJ5q4DL1LVjvtj9q1c2l8A44cEbOO9yFELYxfzWHiJqt WnzbEA65uWmurTN8/zJob3mNf3BOQzdX9eCBeho0PWuF5C6HPHh6VVX4JeIXK/OjN5LB B/nFSeHl2/+ly5p1H8z6qBxJUiuT5spVy+vVC9FqdeZWt0696glLDJkSMCY09yElcADV 2XSQ== X-Gm-Message-State: AOAM533il76c2Ks5rNhixnnjCxlBVdnUUiO56/+Pb+dmwLcB6PMvw0uj gLbHoDn+DacbZm+svrxeDV5meSLlaTp2XKrqGTw= X-Google-Smtp-Source: ABdhPJwm5XAuoeOFgp7lKIDJEuRKhKg31buCY+N/ZfNV7a8C/hJez6utFb4tZuP0xz6w1mB69OnusyjWsBDlRC7vkLo= X-Received: by 2002:ac8:6c6:: with SMTP id j6mr20307684qth.194.1590993605401; Sun, 31 May 2020 23:40:05 -0700 (PDT) MIME-Version: 1.0 References: <1590561903-13186-1-git-send-email-iamjoonsoo.kim@lge.com> <45a8ee8b-ec3a-df0f-fe23-6f64097cd263@suse.cz> In-Reply-To: From: Joonsoo Kim Date: Mon, 1 Jun 2020 15:40:00 +0900 Message-ID: Subject: Re: [PATCH v2 00/12] clean-up the migration target allocation functions To: Vlastimil Babka Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Michal Hocko , Joonsoo Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 72C5C16A0AB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 29=EC=9D=BC (=EA=B8=88) =EC=98=A4=ED=9B=84 3:50, J= oonsoo Kim =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > 2020=EB=85=84 5=EC=9B=94 29=EC=9D=BC (=EA=B8=88) =EC=98=A4=EC=A0=84 4:25,= Vlastimil Babka =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > > > On 5/27/20 8:44 AM, js1304@gmail.com wrote: > > > From: Joonsoo Kim > > > > > > This patchset clean-up the migration target allocation functions. > > > > > > * Changes on v2 > > > - add acked-by tags > > > - fix missing compound_head() call for the patch #3 > > > - remove thisnode field on alloc_control and use __GFP_THISNODE direc= tly > > > - fix missing __gfp_mask setup for the patch > > > "mm/hugetlb: do not modify user provided gfp_mask" > > > > > > * Cover-letter > > > > > > Contributions of this patchset are: > > > 1. unify two hugetlb alloc functions. As a result, one is remained. > > > 2. make one external hugetlb alloc function to internal one. > > > 3. unify three functions for migration target allocation. > > > > > > The patchset is based on next-20200526. > > > The patchset is available on: > > > > I went through the series and I'd like to make some high-level suggesti= ons > > first, that should hopefully simplify the code a bit more and reduce ch= urn: > > Thanks for review! > I have not enough time today to check your suggestions. > I will check on next week and then reply again. > > Thanks. > > > - in the series, alloc_huge_page_nodemask() becomes the only caller of > > alloc_migrate_huge_page(). So you can inline the code there, and it's o= ne less > > function out of many with similar name :) > > > > - after that, alloc_huge_page_nodemask(ac) uses ac mostly just to extra= ct > > individual fields, and only pass it as a whole to dequeue_huge_page_nod= emask(). > > The only other caller of dequeue...() is dequeue_huge_page_vma() who ha= s to > > construct ac from scratch. It might be probably simpler not to introduc= e struct > > alloc_control into hugetlb code at all, and only keep it for > > alloc_migrate_target(), at which point it can have a more specific name= as > > discussed and there's less churn > > > > - I'd suggest not change signature of migrate_pages(), free_page_t and > > new_page_t, keeping the opaque private field is fine as not all callbac= ks use > > struct alloc_context pointer, and then e.g. compaction_alloc has to use= the > > private field etc. alloc_migration_target() can simply cast the private= to > > struct alloc_control *ac as the first thing Looks like all your suggestions are reasonable. I will try them and make v3= . Thanks.