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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 5F708C433E0 for ; Thu, 18 Mar 2021 11:38:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CFFEE64F2B for ; Thu, 18 Mar 2021 11:38:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFFEE64F2B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5236E6B0070; Thu, 18 Mar 2021 07:38:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D2B78D0001; Thu, 18 Mar 2021 07:38:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C1BB6B0072; Thu, 18 Mar 2021 07:38:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id 226886B0070 for ; Thu, 18 Mar 2021 07:38:04 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D818F181AF5FA for ; Thu, 18 Mar 2021 11:38:03 +0000 (UTC) X-FDA: 77932796046.04.E044780 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf18.hostedemail.com (Postfix) with ESMTP id 6485A2000249 for ; Thu, 18 Mar 2021 11:38:03 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1616067482; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5en59u2vhZFX9B//yzzeVhhgJpV6/PW65MgkV2h14ek=; b=t4zk6oPAgCfU9r48PlULtgbLpV0TdPucVWM4kwM5Yt7TGi1GFxiSgTklp2BU7u/5Wb1S1k 5TxgV9gKvRS8Dhk1lbx1Syh9Ng1oNSA9yXzRFpxVAjdx0S/Jc+QV9YAdLWH8lcPj7Olpm2 S33IKdc8eXKGeTw6WXrbotHPSUr0QOc= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5B49AACBF; Thu, 18 Mar 2021 11:38:02 +0000 (UTC) Date: Thu, 18 Mar 2021 12:37:44 +0100 From: Michal Hocko To: Oscar Salvador Cc: Andrew Morton , Vlastimil Babka , David Hildenbrand , Muchun Song , Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 1/5] mm,page_alloc: Bail out earlier on -ENOMEM in alloc_contig_migrate_range Message-ID: References: <20210317111251.17808-1-osalvador@suse.de> <20210317111251.17808-2-osalvador@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 6485A2000249 X-Stat-Signature: mzwmzo5m66q5tng4kdwbcgiyir7x6knd Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616067483-679352 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 Thu 18-03-21 12:04:00, Oscar Salvador wrote: > On Wed, Mar 17, 2021 at 03:05:40PM +0100, Michal Hocko wrote: > > That being said, bailing out early makes sense to me. But now that > > you've made me look into the migrate_pages excellent error state reporting > > I suspect we have a bug here. Note the > > "Returns the number of pages that were not migrated, or an error code." > > > > but I do not see putback_movable_pages for ret > 0 so it seems we might > > leak some pages. > > I fell for the same thing when looking at that code. > It took a while until I realized what was really going on. > > > > Signed-off-by: Oscar Salvador > > > Acked-by: Vlastimil Babka > > > Reviewed-by: David Hildenbrand > > > > The patch itself looks reasonable but make sure to mention this is mere > > cosmetic change unless there is a real problem fixed by this. > > Acked-by: Michal Hocko > > What about appending the following in the changelog: > > "Note that this is not fixing a real issue, just a cosmetic change. Although > we can save some cycles by backing off ealier." Sounds good to me. -- Michal Hocko SUSE Labs