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=-1.0 required=3.0 tests=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 A9EB0C433DF for ; Fri, 26 Jun 2020 07:33:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6D80F2076E for ; Fri, 26 Jun 2020 07:33:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D80F2076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0E7EF6B000E; Fri, 26 Jun 2020 03:33:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0979E6B0010; Fri, 26 Jun 2020 03:33:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF8106B0022; Fri, 26 Jun 2020 03:33:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0053.hostedemail.com [216.40.44.53]) by kanga.kvack.org (Postfix) with ESMTP id D4B8A6B000E for ; Fri, 26 Jun 2020 03:33:46 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 90353824556B for ; Fri, 26 Jun 2020 07:33:46 +0000 (UTC) X-FDA: 76970548452.07.hat67_4f0e30e26e53 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 5D3481803FD61 for ; Fri, 26 Jun 2020 07:33:46 +0000 (UTC) X-HE-Tag: hat67_4f0e30e26e53 X-Filterd-Recvd-Size: 4885 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Fri, 26 Jun 2020 07:33:45 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id a6so8460300wrm.4 for ; Fri, 26 Jun 2020 00:33:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=0BsORbavqGPY3g2MRQ6uJFdI1egNxjb5jhEOHzC1dZo=; b=fd2sOpJgA9b35/rQMiTc7Cr+cnOlDUemUaHH7w2h4mNte6YqdOKPzmOJvyhP1AJqW+ sjjTD5nVtHVSqykN0kw5i19wqmW7zfumpdUYlbZ6egmT8ysYz+eEQUAxQ+sYibl8gYMY bgprB90+X8fcMquC/6sbTph+Ic1WwoJTHknnCpju+B/upQmzeWxZgyAoKIo4Hc3S14j9 JhOGbgfks8GNXGb81HQSqaxsclhspivjJxLxniJ+m1GCxR6Q4nth4xpYYQ3ApVFIQhzH sdXIDYWbTIiMHrVAO7Mg+jqV7M+zt/LOJboU8XIlKIF9SLqZzTqg14P8KrdnSstwN/d1 nvJA== X-Gm-Message-State: AOAM533lSR9lMvfShZYzWcWy1zeU+jJ1+yWyrULTbXaV4tonAxMSephv SNf5ytOAy2aG4UueEp74Gnw= X-Google-Smtp-Source: ABdhPJwHliJaxli5h2H51YeMB/GdPDFC2mGM3N5+8iAvy6Fc/tDyXB47CRZCUVW4oiO5hPZ7wNI8Dw== X-Received: by 2002:a5d:610a:: with SMTP id v10mr2263115wrt.108.1593156825019; Fri, 26 Jun 2020 00:33:45 -0700 (PDT) Received: from localhost (ip-37-188-168-3.eurotel.cz. [37.188.168.3]) by smtp.gmail.com with ESMTPSA id d13sm20607853wrn.61.2020.06.26.00.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 00:33:44 -0700 (PDT) Date: Fri, 26 Jun 2020 09:33:42 +0200 From: Michal Hocko To: Joonsoo Kim Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Vlastimil Babka , Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Joonsoo Kim Subject: Re: [PATCH v3 5/8] mm/migrate: make a standard migration target allocation function Message-ID: <20200626073342.GU1320@dhcp22.suse.cz> References: <1592892828-1934-1-git-send-email-iamjoonsoo.kim@lge.com> <1592892828-1934-6-git-send-email-iamjoonsoo.kim@lge.com> <20200625120550.GF1320@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 5D3481803FD61 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: On Fri 26-06-20 14:02:49, Joonsoo Kim wrote: > 2020=EB=85=84 6=EC=9B=94 25=EC=9D=BC (=EB=AA=A9) =EC=98=A4=ED=9B=84 9:0= 5, Michal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > > > On Tue 23-06-20 15:13:45, Joonsoo Kim wrote: [...] > > > -struct page *new_page_nodemask(struct page *page, > > > - int preferred_nid, nodemask_t *nodema= sk) > > > +struct page *alloc_migration_target(struct page *page, unsigned lo= ng private) > > > { > > > - gfp_t gfp_mask =3D GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAY= FAIL; > > > + struct migration_target_control *mtc; > > > + gfp_t gfp_mask; > > > unsigned int order =3D 0; > > > struct page *new_page =3D NULL; > > > + int zidx; > > > + > > > + mtc =3D (struct migration_target_control *)private; > > > + gfp_mask =3D mtc->gfp_mask; > > > > > > if (PageHuge(page)) { > > > return alloc_huge_page_nodemask( > > > - page_hstate(compound_head(page)), > > > - preferred_nid, nodemask, 0, false); > > > + page_hstate(compound_head(page)), mtc= ->nid, > > > + mtc->nmask, gfp_mask, false); > > > } > > > > > > if (PageTransHuge(page)) { > > > + gfp_mask &=3D ~__GFP_RECLAIM; > > > > What's up with this gfp_mask modification? >=20 > THP page allocation uses a standard gfp masks, GFP_TRANSHUGE_LIGHT and > GFP_TRANHUGE. __GFP_RECLAIM flags is a big part of this standard mask d= esign. > So, I clear it here so as not to disrupt the THP gfp mask. Why this wasn't really needed before? I guess I must be missing something here. This patch should be mostly mechanical convergence of existing migration callbacks but this change adds a new behavior AFAICS. It would effectively drop __GFP_RETRY_MAYFAIL and __GFP_KSWAPD_RECLAIM from the mask so the allocation would "lighter". If that is your intention then this should be a separate patch with an explanation rather than hiding it into this patch. --=20 Michal Hocko SUSE Labs