Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp966864ybt; Tue, 7 Jul 2020 04:47:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGjrWKQdqPHhrAWEK93rLtynM6iFpV9ZpxuvwsVVe5fn14mmn9Kurwp/w6BCVqLIKde6Uz X-Received: by 2002:a17:906:a84d:: with SMTP id dx13mr40285895ejb.246.1594122477277; Tue, 07 Jul 2020 04:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594122477; cv=none; d=google.com; s=arc-20160816; b=OOmZX23CzRjCtcuXTLa7jrz2abJu45soxEvsTZWeLkAoJJzE5YKDzQcLCwSDZY+X0w BdIhc2Od8UcB1j8CLgIX7kdCSi9pejhNdUnBwunVDefSMoFUM9WAXGm9oijQvjRbE5DF X26P3uimuVNGO7pEYeNW2LYMyKTuJ5QACes/AMd+u6ZTCyOWyamX9Aqk/XU8O2NUe+dU tdxvZuqzgE81FnE0tgyCs9CVhDIeO09vf93WuCClPDs/yccANfZWzQtgaH7+bLiU6NPu d7+sgeA6ijM1PQQDFreEmNNlbCp+o3jtFmvFW7vhxf/t9zVVPoxiErU2mqwbb+X67EHn s9Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=f/159hiHL9x+UhJssAcBn7P97Ay6xtu9/dua98ccUME=; b=jD4eYkGQaM+ZCZKHaC2wResmgQbGikwKf2Y8g4/RHueqOIVL5zJsbK2RKD1baJXnM5 LA8JHIPjbNk6KDIrq/aQAk4kfa0iCRTvnelknO9CXhsvpqHH7tg+BxgRU6wtybssUUma wUhMljvpUjoAjPM2cRs1465Sszpb+D33MynxWPk1EInZsJErtFlhlmi4c0XpkAw7reWG 3qGhyOpAFv/zovi7KJBKFWnd5C0r7Cb4nAB8Vf6edb3xjVZnQDxQ2gogMha64HbAmAxv 2X/sTAvBj1gQxzkOCcmvSN0ZF7A/cHdw3u8pVcAbmcyOhQbBnYBk5sA+y1KVoDYLfSdy 5njw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p11si15713864edq.445.2020.07.07.04.47.33; Tue, 07 Jul 2020 04:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728552AbgGGLqT (ORCPT + 99 others); Tue, 7 Jul 2020 07:46:19 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39053 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727800AbgGGLqS (ORCPT ); Tue, 7 Jul 2020 07:46:18 -0400 Received: by mail-wr1-f66.google.com with SMTP id q5so44779319wru.6 for ; Tue, 07 Jul 2020 04:46:17 -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:in-reply-to; bh=f/159hiHL9x+UhJssAcBn7P97Ay6xtu9/dua98ccUME=; b=MGxsMd/T4jtE1UVERbmQEGB6wQRUXqYx3KRN8HB2RMuA4CoTK8uTaj8ASHT6jFml3a edvzKlo4Whpzl5DNjsZTdWeukvdIQEmIJ/hwJGt+COp+qFcfIYd3fIwJCMdkjDrPDhE4 vfAeWeiOvhMrvlmZnsvqzE4pWt1BdLOZ5kaa0hLsqNaBNuoh0HrjGVJpL0DeId3u+N7x toV+PzMQyHxfmX7mA+T65q9NXmZ9J7yKdJ4hs8fhkuWgh4jAgmOBGM4jTSWWpdAX5HMf vcBPluiB5Nb7OylnlcEnwxA4STg3xBBuhWSVVteBPxiqtI7/oxzfnwaemNt6X9dtlX7e gKow== X-Gm-Message-State: AOAM5311zuxYpdFyR4VYuWuHqbCIGl2qogOvCY7OufFgLvjDXnF0P3aJ tUkZJAGm8MQoVBT6zXNdiL0= X-Received: by 2002:a5d:4b84:: with SMTP id b4mr56132552wrt.334.1594122376662; Tue, 07 Jul 2020 04:46:16 -0700 (PDT) Received: from localhost (ip-37-188-179-51.eurotel.cz. [37.188.179.51]) by smtp.gmail.com with ESMTPSA id b23sm824230wmd.37.2020.07.07.04.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 04:46:15 -0700 (PDT) Date: Tue, 7 Jul 2020 13:46:14 +0200 From: Michal Hocko To: js1304@gmail.com Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, Vlastimil Babka , Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Joonsoo Kim Subject: Re: [PATCH v4 07/11] mm/gup: use a standard migration target allocation callback Message-ID: <20200707114614.GK5913@dhcp22.suse.cz> References: <1594107889-32228-1-git-send-email-iamjoonsoo.kim@lge.com> <1594107889-32228-8-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1594107889-32228-8-git-send-email-iamjoonsoo.kim@lge.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 07-07-20 16:44:45, Joonsoo Kim wrote: [...] > @@ -1551,9 +1552,12 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) > > gfp_mask |= htlb_alloc_mask(h); > return alloc_huge_page_nodemask(h, nid, mtc->nmask, > - gfp_mask, false); > + gfp_mask, mtc->skip_cma); > } > > + if (mtc->skip_cma) > + flags = memalloc_nocma_save(); > + As already mentioned in previous email this is a completely wrong usage of the scope API. The scope should be defined by the caller and this should be all transparent by the allocator layer. > if (PageTransHuge(page)) { > /* > * clear __GFP_RECALIM since GFP_TRANSHUGE is the gfp_mask > @@ -1572,6 +1576,9 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) > if (new_page && PageTransHuge(new_page)) > prep_transhuge_page(new_page); > > + if (mtc->skip_cma) > + memalloc_nocma_restore(flags); > + > return new_page; > } > > -- > 2.7.4 -- Michal Hocko SUSE Labs