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 1B142C433E0 for ; Fri, 29 May 2020 06:50:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CA2352074D for ; Fri, 29 May 2020 06:50:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V0jsynJr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA2352074D 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 69F308001A; Fri, 29 May 2020 02:50:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6500380010; Fri, 29 May 2020 02:50:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 564E08001A; Fri, 29 May 2020 02:50:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0180.hostedemail.com [216.40.44.180]) by kanga.kvack.org (Postfix) with ESMTP id 3DC6A80010 for ; Fri, 29 May 2020 02:50:45 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E5AF0181AEF0B for ; Fri, 29 May 2020 06:50:44 +0000 (UTC) X-FDA: 76868833608.02.face76_67c280029624 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id CA7722489 for ; Fri, 29 May 2020 06:50:44 +0000 (UTC) X-HE-Tag: face76_67c280029624 X-Filterd-Recvd-Size: 5421 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Fri, 29 May 2020 06:50:44 +0000 (UTC) Received: by mail-qk1-f175.google.com with SMTP id 205so1331443qkg.3 for ; Thu, 28 May 2020 23:50:44 -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=qRkkDEMBa8+Sw1PQF85wu1nOLeFHhIPcQ18vc9mOo9I=; b=V0jsynJr91xXD3ECziMlTvwwY3BIzgFRTP48yQLtFSySSTn9Y5w10c7lTVq/3wBak7 7dMlGLXQ4Jq7vq3+hqKy0xLxKaA8NRHzbkaKwvSrQ9wTEF/lgHsFw1QGrmJ+8mbJFrAS KvQVFZGrYQ1/MFx1T4ctxLoDv+qEQOurqvxj3qaQVDekQfLfp++idJ400vfGs6SbWPe6 TAkatuLCQ1TfynB6eGOWQs5HLY2mIj70JdApYXViVZslGQUyLoN97dIUW35lJK1uKWvT lLxutF829bHLmgEhZ4KZbSMkhyz1+PMz3zwUn6x6c04i/O+JM/UUxHul1nfz0z2pQrXN rWcA== 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=qRkkDEMBa8+Sw1PQF85wu1nOLeFHhIPcQ18vc9mOo9I=; b=Gerd2MLPIoYSI8VN1IY5wXW9pzdmWOl3IfQI5mnVTD7BopGsDOvBh3QiEkdHuR3hXT ohPwuGxUmlzI3xnG9KFHue9yAHrF+VeGsjgitXM/GpKdEVqAzrInOdu5lx4iQLQ9FEjf zHpH5mv70Jcy5MltzyhLdTiBBol77xQVu7HZGksyM1L6/LvSK451WedRmkMxqA3HcdGP ZxK09kI/jZ7ND4az0ZOjpD/KMV5hprq1S2UqZtnJM3vLGr1KCyZl2RKD8d0LqgHiABS0 Up2njF+BIWdh+kFYtsil13IMSa/h3MuUXlvPExZLwcsjdAK5VUiA1P3K/9I6CHCS4U/8 zHLQ== X-Gm-Message-State: AOAM533xe4lOd38zXZfdTJ9YkMpdCSc9aViFqCxiFwM+ZA+QG10D4bDK Um6y1LI3pG2y9Ulr1epJBY6T8JwcZXvSIBE+to4= X-Google-Smtp-Source: ABdhPJzPqcVGzu201fZFnPLWkfprZQBErzcQSvNNlVp5TtnFbh0zFNrA7C3UrybY84bym68Wh4QxRMI+1zu1SDYt5IU= X-Received: by 2002:a05:620a:164c:: with SMTP id c12mr5919292qko.343.1590735043874; Thu, 28 May 2020 23:50:43 -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: <45a8ee8b-ec3a-df0f-fe23-6f64097cd263@suse.cz> From: Joonsoo Kim Date: Fri, 29 May 2020 15:50:33 +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: CA7722489 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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=EC=A0=84 4:25, V= lastimil 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 directl= y > > - 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 suggestion= s > first, that should hopefully simplify the code a bit more and reduce chur= n: 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 one= less > function out of many with similar name :) > > - after that, alloc_huge_page_nodemask(ac) uses ac mostly just to extract > individual fields, and only pass it as a whole to dequeue_huge_page_nodem= ask(). > The only other caller of dequeue...() is dequeue_huge_page_vma() who has = to > construct ac from scratch. It might be probably simpler not to introduce = 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 a= s > 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 callbacks= use > struct alloc_context pointer, and then e.g. compaction_alloc has to use t= he > private field etc. alloc_migration_target() can simply cast the private t= o > struct alloc_control *ac as the first thing