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=-8.8 required=3.0 tests=BAYES_00, 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 5A682C433E6 for ; Thu, 18 Mar 2021 11:04:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1720364F53 for ; Thu, 18 Mar 2021 11:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbhCRLES (ORCPT ); Thu, 18 Mar 2021 07:04:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:52304 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230425AbhCRLEE (ORCPT ); Thu, 18 Mar 2021 07:04:04 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DBB43AC1E; Thu, 18 Mar 2021 11:04:02 +0000 (UTC) Date: Thu, 18 Mar 2021 12:04:00 +0100 From: Oscar Salvador To: Michal Hocko 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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." -- Oscar Salvador SUSE L3