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=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 0BF52C11F67 for ; Tue, 29 Jun 2021 16:05:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE9DD61DC0 for ; Tue, 29 Jun 2021 16:05:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE9DD61DC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F15DE8D0154; Tue, 29 Jun 2021 12:05:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EECE68D00F0; Tue, 29 Jun 2021 12:05:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D67678D0154; Tue, 29 Jun 2021 12:05:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0105.hostedemail.com [216.40.44.105]) by kanga.kvack.org (Postfix) with ESMTP id B3FB18D00F0 for ; Tue, 29 Jun 2021 12:05:03 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9E68A181FC56F for ; Tue, 29 Jun 2021 16:05:03 +0000 (UTC) X-FDA: 78307235286.28.06E246A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf25.hostedemail.com (Postfix) with ESMTP id 34C56B000098 for ; Tue, 29 Jun 2021 16:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624982702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jPo7Zi5FmBECpYBIqUfrz1T3JgVzlEIG1jHt2GCIjvg=; b=P9AED9o+XrA+zUjTnsR2/LO68WVqMfWV7V3ScWtLlaQ3qrLQfuaClRNNsiwV8vMKeIDQ7r Vcp4Vj8c6H96P91a6p0+/MMxtRPRcZ8z8/+RbPkFxrKthRNNI7y8M2keat3mJy9ZOPAQBI yMJBbDHhnZR8rB3oZSYsEVnWdia1T/s= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-307-aP7wJ-VtPwuIN1mSNSEeWw-1; Tue, 29 Jun 2021 12:05:01 -0400 X-MC-Unique: aP7wJ-VtPwuIN1mSNSEeWw-1 Received: by mail-ed1-f70.google.com with SMTP id w1-20020a0564022681b0290394cedd8a6aso11682773edd.14 for ; Tue, 29 Jun 2021 09:05:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=jPo7Zi5FmBECpYBIqUfrz1T3JgVzlEIG1jHt2GCIjvg=; b=ULMwhodfWKca2u/dNgSeVe9dKuP6xB36DbDjn+nDAzT7cYHtPY0SWas2jXGO4zacBi 7+be+BkauYEV84Xk/3nBhlEEw6CbR8+5JYYSSQ0k/1mCBn47OQDPnEM+qLu+cFd4xGj8 RS7LDkNLGMOYr55WEDf1ntY2PkN2CmZ7gKB7mEKRhCF3qpP+WY+r3Cbb7tm1CFcYjjj9 ob68T8X8xcWi6PPuh27QUg9NkCDqrCa7z2Ki8EHZTBKdrAWeN51hrOLuehSD2SsWfafW c0qDhL3BYOxSEfRng/ol9yGTKNxLvbDA+tYlBbKVB5CbDxGWSTH55u+G3F7j2R9/mqWx KRkg== X-Gm-Message-State: AOAM530dUj7ZrE2GU0pWc6FQjG4YN1xLL3qywDDI6w+Y4rGTHskqAoeQ d1NGBYx+FW8o1ePQwWRei+sD3UbA4cTVn0VkYw+gnQON6s8F3RJtnwsItlBTqgvsbZi3fS+kd1j O0C6wsQTxdMg= X-Received: by 2002:a17:906:ce4f:: with SMTP id se15mr31507153ejb.232.1624982699467; Tue, 29 Jun 2021 09:04:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdqcA8oR0whtpagOajeaVnQl2znUUn/4oZw3mN5BmiJLX/jJLSXjbnFLWZCri9kjKOa+L1rQ== X-Received: by 2002:a17:906:ce4f:: with SMTP id se15mr31507140ejb.232.1624982699360; Tue, 29 Jun 2021 09:04:59 -0700 (PDT) Received: from [192.168.42.238] (3-14-107-185.static.kviknet.dk. [185.107.14.3]) by smtp.gmail.com with ESMTPSA id z26sm472318eja.26.2021.06.29.09.04.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Jun 2021 09:04:59 -0700 (PDT) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Subject: Re: [PATCH v3] mm/page_alloc: Further fix __alloc_pages_bulk() return value To: Mel Gorman , Chuck Lever Cc: linux-nfs@vger.kernel.org, linux-mm@kvack.org, brouer@redhat.com References: <162497449506.16614.7781489905877008435.stgit@klimt.1015granger.net> <20210629153349.GG3840@techsingularity.net> Message-ID: Date: Tue, 29 Jun 2021 18:04:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210629153349.GG3840@techsingularity.net> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 34C56B000098 Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=P9AED9o+; spf=none (imf25.hostedemail.com: domain of jbrouer@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=jbrouer@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: nkm6by51qa4q9xo7bmfyirhn4yi4y5n7 X-HE-Tag: 1624982703-685528 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 29/06/2021 17.33, Mel Gorman wrote: > On Tue, Jun 29, 2021 at 09:48:15AM -0400, Chuck Lever wrote: >> The author of commit b3b64ebd3822 ("mm/page_alloc: do bulk array >> bounds check after checking populated elements") was possibly >> confused by the mixture of return values throughout the function. >> >> The API contract is clear that the function "Returns the number of >> pages on the list or array." It does not list zero as a unique >> return value with a special meaning. Therefore zero is a plausible >> return value only if @nr_pages is zero or less. >> >> Clean up the return logic to make it clear that the returned value >> is always the total number of pages in the array/list, not the >> number of pages that were allocated during this call. >> >> The only change in behavior with this patch is the value returned >> if prepare_alloc_pages() fails. To match the API contract, the >> number of pages currently in the array/list is returned in this >> case. >> >> The call site in __page_pool_alloc_pages_slow() also seems to be >> confused on this matter. It should be attended to by someone who >> is familiar with that code. >> >> Signed-off-by: Chuck Lever > Acked-by: Mel Gorman > Acked-by: Jesper Dangaard Brouer