Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B739C74A5B for ; Tue, 21 Mar 2023 07:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230479AbjCUHzq (ORCPT ); Tue, 21 Mar 2023 03:55:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbjCUHzm (ORCPT ); Tue, 21 Mar 2023 03:55:42 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B9321C7F5; Tue, 21 Mar 2023 00:55:41 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EED6A21A70; Tue, 21 Mar 2023 07:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1679385339; h=from:from:reply-to: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=9cGY12kDQSwASIHfhJiV2pRr9ipekQXRkFafDBu1XBk=; b=egdeMcqdv25PErCesAzCg289ZaANuPs9QP53OZbgodUWtlljfv5IWJ1hr/r6URWplpp0/j NQ/PGyNDQXvcO+hxCR3tu7qSvhPa+9FpS7uObiD5RQMD24KGMQnbgCRoZlmhZE8Ea1QU01 ND3mqsU4qfp/DPOeFiYkdrtrjuCanyc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1679385339; h=from:from:reply-to: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=9cGY12kDQSwASIHfhJiV2pRr9ipekQXRkFafDBu1XBk=; b=wDA9s17OE8q24MWB2jK0ByNbJtNmEbp17cxlen43oljpli0F+NRSPrNQkLSJEfsnfMUVWc PQ8fctZ/cwcFyVAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BFE5C13440; Tue, 21 Mar 2023 07:55:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id fOAKLvtiGWR2NwAAMHmgww (envelope-from ); Tue, 21 Mar 2023 07:55:39 +0000 Message-ID: Date: Tue, 21 Mar 2023 08:55:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 04/10] drm/i915: Fix MAX_ORDER usage in i915_gem_object_get_pages_internal() Content-Language: en-US To: "Kirill A. Shutemov" , Andrew Morton , Mel Gorman , David Hildenbrand Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin References: <20230315113133.11326-1-kirill.shutemov@linux.intel.com> <20230315113133.11326-5-kirill.shutemov@linux.intel.com> From: Vlastimil Babka In-Reply-To: <20230315113133.11326-5-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/15/23 12:31, Kirill A. Shutemov wrote: > MAX_ORDER is not inclusive: the maximum allocation order buddy allocator > can deliver is MAX_ORDER-1. > > Fix MAX_ORDER usage in i915_gem_object_get_pages_internal(). > > Signed-off-by: Kirill A. Shutemov Acked-by: Vlastimil Babka > Cc: Jani Nikula > Cc: Joonas Lahtinen > Cc: Rodrigo Vivi > Cc: Tvrtko Ursulin > --- > drivers/gpu/drm/i915/gem/i915_gem_internal.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_internal.c b/drivers/gpu/drm/i915/gem/i915_gem_internal.c > index 6bc26b4b06b8..eae9e9f6d3bf 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_internal.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_internal.c > @@ -36,7 +36,7 @@ static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj) > struct sg_table *st; > struct scatterlist *sg; > unsigned int npages; /* restricted by sg_alloc_table */ > - int max_order = MAX_ORDER; > + int max_order = MAX_ORDER - 1; > unsigned int max_segment; > gfp_t gfp; >