From patchwork Tue Jul 23 19:18:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Savkov X-Patchwork-Id: 2832882 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 817569F4D4 for ; Wed, 24 Jul 2013 15:09:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD0112039D for ; Wed, 24 Jul 2013 15:09:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CA28520399 for ; Wed, 24 Jul 2013 15:09:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D06CFE6AFF for ; Wed, 24 Jul 2013 08:09:05 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 10A1DE5C5F; Tue, 23 Jul 2013 12:18:14 -0700 (PDT) Received: by mail-lb0-f174.google.com with SMTP id x10so6674303lbi.33 for ; Tue, 23 Jul 2013 12:18:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=TpSYTiFzKrasa/Cd7yynbAujUwjseR2Zjipb8OLE0zI=; b=K6QLioOi2+6z7434smYBKZU6uNr9bXa2jWpcunlz9FPietnZLuyqXJLmKtgZcBW2Hg OksAWbC6SDcFLqz/ZcudDupkf5+0JM7lN8vVw6hM7sKf/Y15ZtIviJ96YRqVzdocaclg vTaj4QxeeWDrFLadHmMkf3XR52qupU12DzfYEpZXeThrDX6UKwq0Smakfw9IROc/T48k IDxFRi5yXo/NOM+hLhgjp7A22FALVITGOV12prbAS2PuDieWzbxnSpWipgJdXfN2bJAQ 4PgjACP1dxIbs2PffzMb5CM4+X7LqOg/l5YS8bmfhk9wJQdIbWAGxtQc6G3HkmxwgjiD wVSw== X-Received: by 10.152.43.52 with SMTP id t20mr15385780lal.62.1374607094055; Tue, 23 Jul 2013 12:18:14 -0700 (PDT) Received: from localhost (249.177.smarthome.spb.ru. [109.71.177.249]) by mx.google.com with ESMTPSA id n3sm13620150lag.9.2013.07.23.12.18.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 23 Jul 2013 12:18:13 -0700 (PDT) From: Artem Savkov To: dchinner@redhat.com, glommer@openvz.org Date: Tue, 23 Jul 2013 23:18:06 +0400 Message-Id: <1374607086-6761-1-git-send-email-artem.savkov@gmail.com> X-Mailer: git-send-email 1.8.3.3 X-Mailman-Approved-At: Wed, 24 Jul 2013 08:07:41 -0700 Cc: Artem Savkov , airlied@linux.ie, daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH] drm: i915_gem_inactive_scan: insufficient nr_to_scan size X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP nr_to_scan needs to be (unsigned) long, not int, otherwise we get negative values on 32bit systems during shrink resulting in lots of messages like one below. [ 4078.989603] shrink_slab: i915_gem_inactive_scan+0x0/0xc0 negative objects to delete nr=-289580136 Introduced in "drivers: convert shrinkers to new count/scan API" (383e4f4a4cdeb2dd552e90811089bcb4d41eb32e in linux-next.git) Signed-off-by: Artem Savkov --- drivers/gpu/drm/i915/i915_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 4635354..b3b4891b 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -4649,7 +4649,7 @@ i915_gem_inactive_scan(struct shrinker *shrinker, struct shrink_control *sc) struct drm_i915_private, mm.inactive_shrinker); struct drm_device *dev = dev_priv->dev; - int nr_to_scan = sc->nr_to_scan; + unsigned long nr_to_scan = sc->nr_to_scan; unsigned long freed; bool unlock = true;