Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp545953rwj; Thu, 22 Dec 2022 11:03:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXsCjRu2GlqUtxH92VhQ6AkU7JNuLr1/CCXdSTWHPw9LMlNd5nayaDbzY7He/9QU2gjKXG4M X-Received: by 2002:a17:906:71c3:b0:7c0:dd80:e95e with SMTP id i3-20020a17090671c300b007c0dd80e95emr9062805ejk.51.1671735818000; Thu, 22 Dec 2022 11:03:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671735817; cv=none; d=google.com; s=arc-20160816; b=dqWFq5GwTW11/GLOjKU1hzWC0MjCnE3Ixd0T659L8gt8Gaj2ANbkwr+9g0095UaUSK Oc0dBFoD1aOrw3JeOo7U31DyDK/kvw4Km1kXWT0UQMa+jleBWUqDKSjs1pW9sFQgNMFh AcddQR3pK2s+iIG8MCckBSVHicB8t1WbqziowDHmjG9aZL0+xdSGFT8ZP6tmobqQHiWr iKbJX53Zpi44nU9QoVXtQSXDOCVFFBMuJCBmc6xx1Elzi+H/LRMY/XWt04Zoavj6XXLR CkMARji8P1Jl4soc8H5CsZw1Fz5d6s911CWe2hjrPBLNuviFV+9BT8ge9X9bOEGurkLc 3Gig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=mZRm9urdOthWqTYxAw02fxkoMKYNKeTirXSn3tbLtpc=; b=olvm19MWxHwQY7y765NGYlw3de/Czds9xEUEG/ZPUlgu9XuGEOJllsWxHMpmuBVcAi NorlFz5ZMlpqMfeIKzvidHyklg3PlBiC0czS3RxM+igUyRPKscECx/fmfJOXoGScaRgj Mhm9TarFCNKEEkndqglhCQKemxb6hi6k1yPcPEB3IsA0ozZ/VNMeh/QBVzDElkiBGSw0 Ni9LEFt3iY6TmYXRVrEbwIh6nSthalvPhD8onjhi8JI9Nmf7uk8HQtPuQ4aH6IB7iVkD e9TBPV5XFnEy1Lc2G2xQWHIlWS+AFGOqSxVRiuLNegjAXW/UVnS5x4ruM3Gd7gwhl/IV Avyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DqydNKpo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he17-20020a1709073d9100b0078c3197bf86si1146503ejc.533.2022.12.22.11.03.21; Thu, 22 Dec 2022 11:03:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DqydNKpo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231454AbiLVSyb (ORCPT + 68 others); Thu, 22 Dec 2022 13:54:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbiLVSyN (ORCPT ); Thu, 22 Dec 2022 13:54:13 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6CB8275C3 for ; Thu, 22 Dec 2022 10:53:26 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id b24-20020a05600c4a9800b003d21efdd61dso1969249wmp.3 for ; Thu, 22 Dec 2022 10:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mZRm9urdOthWqTYxAw02fxkoMKYNKeTirXSn3tbLtpc=; b=DqydNKpoK6xZ9NSkK2c/6XM/aLr5fmVcnfv97GPGX4t5d7SoTa1+Vj7MbKtmyUz2kG wEZv9euJIhxdwnS5KDjjxd7WRLWoknTnb7dET+eUcY2RTZ3kIF3m+H4D2G5Ky0PknVfL Pb9zTvvYizHD2gGeZwV1XN15iZSqKwdQAZZQMkQzluqK20AayXQfNV9HR5CljPueba3M c5JXXjGBW71+n2yDA7hqZ74NPrTba2GW9H8fRTM2AVHcN4M9Zcp/XU5uf5DrmEdLdUwc uweuf1M7V6MRMRcExOe2U6+80LMwxr2u7ZMnirQicpzKUo+UtZU0ibU3OTdmV9HcNAjU eKCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mZRm9urdOthWqTYxAw02fxkoMKYNKeTirXSn3tbLtpc=; b=iGi0q+l5iIDWy5E76kRe5BxACPGWXzKjQX/wzHM8fCuhImD6atRyDjmZEA48oC354O lhqfKyY9nWpm6zoDfRvK/lt4P8gwm25K0A8mDFs33W66VylUXaI2+8CTYQyRTTCGS4Rl tXLohrJ3Ok1DLCpoQnuIo+DdMArznZ/ONcVjcmWQ9XAnYue1wzqYJiJfZ5Mr/8c0H+Bl u0RXItbCUyjh7fLSaihE9/GqB0d4mbkrsb63fzNo5HUFEeNUZi4J6M8s/ggxSPm4lkP6 6a4ZiRwpdTgdpfA8qvTChJKJ2AjPTXHQCsdNFliXINeybPfeImIv8fpEJpfHdt3txf34 vbIA== X-Gm-Message-State: AFqh2kpdNGg7cll6iDZvDimA3IJbkV1rfJKBGsk6RpYXWJWDmCLrWgKc 5mI+UDPS+N4eemHhfzPpgNg= X-Received: by 2002:a05:600c:15d4:b0:3d1:d746:d95b with SMTP id v20-20020a05600c15d400b003d1d746d95bmr7888624wmf.41.1671735205373; Thu, 22 Dec 2022 10:53:25 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id a6-20020adff7c6000000b002421db5f279sm1163666wrq.78.2022.12.22.10.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 10:53:24 -0800 (PST) Date: Thu, 22 Dec 2022 21:53:20 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, xinhui pan , amd-gfx@lists.freedesktop.org Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, daniel@ffwll.ch, matthew.auld@intel.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, arunpravin.paneerselvam@amd.com, xinhui pan Subject: Re: [PATCH v6] drm: Optimise for continuous memory allocation Message-ID: <202212222042.6Dhv6XWG-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221218065708.93332-1-xinhui.pan@amd.com> X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi xinhui, https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/xinhui-pan/drm-Optimise-for-continuous-memory-allocation/20221218-145922 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/20221218065708.93332-1-xinhui.pan%40amd.com patch subject: [PATCH v6] drm: Optimise for continuous memory allocation config: s390-randconfig-m041-20221218 compiler: s390-linux-gcc (GCC) 12.1.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/drm_buddy.c:501 find_continuous_blocks() error: uninitialized symbol 'block'. vim +/block +501 drivers/gpu/drm/drm_buddy.c 8a257b57bc11a2 xinhui pan 2022-12-18 472 static struct drm_buddy_block * 8a257b57bc11a2 xinhui pan 2022-12-18 473 find_continuous_blocks(struct drm_buddy *mm, 8a257b57bc11a2 xinhui pan 2022-12-18 474 int order, 8a257b57bc11a2 xinhui pan 2022-12-18 475 unsigned long flags, 8a257b57bc11a2 xinhui pan 2022-12-18 476 struct drm_buddy_block **lb) 8a257b57bc11a2 xinhui pan 2022-12-18 477 { 8a257b57bc11a2 xinhui pan 2022-12-18 478 struct list_head *head = &mm->free_list[order - 1]; 8a257b57bc11a2 xinhui pan 2022-12-18 479 struct drm_buddy_block *free_block, *first = NULL, *last = NULL; 8a257b57bc11a2 xinhui pan 2022-12-18 480 8a257b57bc11a2 xinhui pan 2022-12-18 481 /* 8a257b57bc11a2 xinhui pan 2022-12-18 482 * Look for continuous free memory in buddy and buddy-in-law. 8a257b57bc11a2 xinhui pan 2022-12-18 483 * IOW, the most left blocks at right of free block and the most right 8a257b57bc11a2 xinhui pan 2022-12-18 484 * blocks at left of free block. 8a257b57bc11a2 xinhui pan 2022-12-18 485 */ 8a257b57bc11a2 xinhui pan 2022-12-18 486 8a257b57bc11a2 xinhui pan 2022-12-18 487 list_for_each_entry(free_block, head, link) { 8a257b57bc11a2 xinhui pan 2022-12-18 488 struct drm_buddy_block *buddy, *parent, *block; 8a257b57bc11a2 xinhui pan 2022-12-18 489 int left, min_order = 0; 8a257b57bc11a2 xinhui pan 2022-12-18 490 LIST_HEAD(fbl); 8a257b57bc11a2 xinhui pan 2022-12-18 491 8a257b57bc11a2 xinhui pan 2022-12-18 492 parent = free_block->parent; 8a257b57bc11a2 xinhui pan 2022-12-18 493 if (!parent) 8a257b57bc11a2 xinhui pan 2022-12-18 494 continue; 8a257b57bc11a2 xinhui pan 2022-12-18 495 8a257b57bc11a2 xinhui pan 2022-12-18 496 left = parent->left == free_block; 8a257b57bc11a2 xinhui pan 2022-12-18 497 list_add(&free_block->tmp_link, &fbl); 8a257b57bc11a2 xinhui pan 2022-12-18 498 buddy = __get_buddy(free_block); 8a257b57bc11a2 xinhui pan 2022-12-18 499 __continuous_block_in_tree(buddy, &fbl, left, min_order); 8a257b57bc11a2 xinhui pan 2022-12-18 500 8a257b57bc11a2 xinhui pan 2022-12-18 @501 while (parent && !((parent->left == block) ^ left)) { ^^^^^ Not initialized on first iteration. 8a257b57bc11a2 xinhui pan 2022-12-18 502 block = parent; 8a257b57bc11a2 xinhui pan 2022-12-18 503 parent = parent->parent; 8a257b57bc11a2 xinhui pan 2022-12-18 504 } 8a257b57bc11a2 xinhui pan 2022-12-18 505 8a257b57bc11a2 xinhui pan 2022-12-18 506 if (!parent) 8a257b57bc11a2 xinhui pan 2022-12-18 507 continue; 8a257b57bc11a2 xinhui pan 2022-12-18 508 8a257b57bc11a2 xinhui pan 2022-12-18 509 buddy = __get_buddy(block); 8a257b57bc11a2 xinhui pan 2022-12-18 510 __continuous_block_in_tree(buddy, &fbl, !left, min_order); 8a257b57bc11a2 xinhui pan 2022-12-18 511 8a257b57bc11a2 xinhui pan 2022-12-18 512 /* list head of fbl is invalid outside. 8a257b57bc11a2 xinhui pan 2022-12-18 513 * Walk through list from first fo last only. 8a257b57bc11a2 xinhui pan 2022-12-18 514 */ 8a257b57bc11a2 xinhui pan 2022-12-18 515 if (__free_block_in_order(&fbl, free_block, order, &first, &last)) 8a257b57bc11a2 xinhui pan 2022-12-18 516 break; 8a257b57bc11a2 xinhui pan 2022-12-18 517 } 8a257b57bc11a2 xinhui pan 2022-12-18 518 8a257b57bc11a2 xinhui pan 2022-12-18 519 *lb = last; 8a257b57bc11a2 xinhui pan 2022-12-18 520 return first; 8a257b57bc11a2 xinhui pan 2022-12-18 521 } -- 0-DAY CI Kernel Test Service https://01.org/lkp