Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4531917pxv; Tue, 29 Jun 2021 09:09:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLquP+yNVZ99c7YrUFF4XTSacLOlCM4Itq2cBoxWKoE7pgxwjgybVNcIzDBfrSre2GKAAd X-Received: by 2002:a92:bd0f:: with SMTP id c15mr22748973ile.229.1624982940001; Tue, 29 Jun 2021 09:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624982939; cv=none; d=google.com; s=arc-20160816; b=VfQbvhL8efnDfCluBzEyzP2jaGDKILW8zZqx9v7uQ2W+/DBh9KlXlBLsPfVc5I/Mje Z7zx5esiyPZbuywMUfFZ9gAQXigWztpcPX9rp7Q9TnfR4VJhGraU8otR7MfMGrQKiUbv Rbyqxlr23oHPYcFEPuAVQ8VFlwvjGbf2fTGaZbdQJTqRkduiE3shLN9YHiuCKiAogEtg CZPPZ28yaI2HhKoCqCeCxGWM/p4HrfUQ2PSNu56JTE3j416OLRx9rZkeLXvtGlbwsLpr 8pNi+9UNehENApEQziHOgM7zHp5vk5nPnsngP7op3qkOTvJGWwdMzB8oEfD8mcjj10Vq pCjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=jPo7Zi5FmBECpYBIqUfrz1T3JgVzlEIG1jHt2GCIjvg=; b=ucek4a61WQ4mBlPSE7xCJQsOxQXBcSRy2H+ELha2h1jGbX87vproGbL/g/Aaq8RFXj L5w4+1rhOpXZviohHws7+R0g5uCWscO83TdiwM5u62sSoajtBpn6iR/zDNRhyaUzR4jR Ti05tX1IB/hnMcBs1aGHs2lL8ZiKsuJ7fJ4IcEcfsgwocEqOjKQESInypMJ6OfpXYsM1 ultgiQ0YXWCTpntFnQV72SlvX6uASSCk+FYEFlk4XsF08QZV06ejMUjsZB07kVCyII/T 3cW/f9/aabbNyfW0NhvB7nnEZASu40pzvZ7dMI4FzuU02sDAY7EaZci74hOagRm1pzCL TAOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P9AED9o+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o8si6019476jat.91.2021.06.29.09.08.42; Tue, 29 Jun 2021 09:08:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P9AED9o+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232256AbhF2QKU (ORCPT + 99 others); Tue, 29 Jun 2021 12:10:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47623 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232301AbhF2QIL (ORCPT ); Tue, 29 Jun 2021 12:08:11 -0400 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-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-488-roGFYPmOMA6qk_ivcZ_MmQ-1; Tue, 29 Jun 2021 12:05:00 -0400 X-MC-Unique: roGFYPmOMA6qk_ivcZ_MmQ-1 Received: by mail-ed1-f69.google.com with SMTP id p19-20020aa7c4d30000b0290394bdda6d9cso11644319edr.21 for ; Tue, 29 Jun 2021 09:05:00 -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=ihvQYpG9f3kyQ8lFzLX4XA2BNfndEdk7Pyc2I+wkqjDW4kjhLR6POoPf/LgPxhqoYh 9qrtVAIYY4d+Zh7P2FZIFa/4EGRv9DjQYMsIvpvTc9iIzJOi3s47ZfCQnNUl2GA0Tj1R sWLTGvnN91U+U7GSGi/Gqvk08Ahpg6I/5sOueW/D57yqIOQoB7Jb7tddd8qBzHV3nCyR 7OPvr4b8DdwIsXXoIvO6PoYfC1F0CK8LnIN28BuXuYPkaDQH9ImhuirKMU9RxXd7WhYK 68GZADb3GrFbImKSqzIaC7kHSc4MvbKD5rebKBc9CSlwb39Y6BDegM5T0SlaoTwPkJgU itNg== X-Gm-Message-State: AOAM530cjV8SVAfnk/LCulvHGf7oN6K0D1X4g2jf/im927ccMf/X3NQp 5ZXjuxZNwCgfh+qq7vjHX9zsBh3LTVkFg3IqJevBBfQg7Jz5olFR9KgHMBh/DosgRtoi2eucIHB H3b4f1st7Pw+TGsSO19LX X-Received: by 2002:a17:906:ce4f:: with SMTP id se15mr31507152ejb.232.1624982699466; Tue, 29 Jun 2021 09:04:59 -0700 (PDT) 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> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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