dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc()
@ 2019-03-04  9:03 Andy Shevchenko
  2019-03-04  9:03 ` [PATCH v1 2/2] drm: i915: " Andy Shevchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Andy Shevchenko @ 2019-03-04  9:03 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, intel-gfx,
	David Airlie, Daniel Vetter, dri-devel
  Cc: Andy Shevchenko

Switch to bitmap_zalloc() to show clearly what we are allocating.
Besides that it returns pointer of bitmap type instead of opaque void *.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpu/drm/selftests/test-drm_mm.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c
index fbed2c90fd51..d1206aef26af 100644
--- a/drivers/gpu/drm/selftests/test-drm_mm.c
+++ b/drivers/gpu/drm/selftests/test-drm_mm.c
@@ -1615,7 +1615,7 @@ static int igt_topdown(void *ignored)
 	DRM_RND_STATE(prng, random_seed);
 	const unsigned int count = 8192;
 	unsigned int size;
-	unsigned long *bitmap = NULL;
+	unsigned long *bitmap;
 	struct drm_mm mm;
 	struct drm_mm_node *nodes, *node, *next;
 	unsigned int *order, n, m, o = 0;
@@ -1631,8 +1631,7 @@ static int igt_topdown(void *ignored)
 	if (!nodes)
 		goto err;
 
-	bitmap = kcalloc(count / BITS_PER_LONG, sizeof(unsigned long),
-			 GFP_KERNEL);
+	bitmap = bitmap_zalloc(count, GFP_KERNEL);
 	if (!bitmap)
 		goto err_nodes;
 
@@ -1717,7 +1716,7 @@ static int igt_topdown(void *ignored)
 	drm_mm_takedown(&mm);
 	kfree(order);
 err_bitmap:
-	kfree(bitmap);
+	bitmap_free(bitmap);
 err_nodes:
 	vfree(nodes);
 err:
@@ -1745,8 +1744,7 @@ static int igt_bottomup(void *ignored)
 	if (!nodes)
 		goto err;
 
-	bitmap = kcalloc(count / BITS_PER_LONG, sizeof(unsigned long),
-			 GFP_KERNEL);
+	bitmap = bitmap_zcalloc(count, GFP_KERNEL);
 	if (!bitmap)
 		goto err_nodes;
 
@@ -1818,7 +1816,7 @@ static int igt_bottomup(void *ignored)
 	drm_mm_takedown(&mm);
 	kfree(order);
 err_bitmap:
-	kfree(bitmap);
+	bitmap_free(bitmap);
 err_nodes:
 	vfree(nodes);
 err:
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v1 2/2] drm: i915: Switch to bitmap_zalloc()
  2019-03-04  9:03 [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc() Andy Shevchenko
@ 2019-03-04  9:03 ` Andy Shevchenko
  2019-03-04 11:03 ` [PATCH v1 1/2] drm/selftests/mm: " kbuild test robot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2019-03-04  9:03 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, intel-gfx,
	David Airlie, Daniel Vetter, dri-devel
  Cc: Andy Shevchenko

Switch to bitmap_zalloc() to show clearly what we are allocating.
Besides that it returns pointer of bitmap type instead of opaque void *.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c               | 2 +-
 drivers/gpu/drm/i915/i915_gem_fence_reg.c     | 3 +--
 drivers/gpu/drm/i915/i915_gem_tiling.c        | 6 +++---
 drivers/gpu/drm/i915/selftests/intel_uncore.c | 5 ++---
 4 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 6728ea5c71d4..0d96520cfdb3 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4410,7 +4410,7 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,
 		drm_gem_object_release(&obj->base);
 		i915_gem_info_remove_obj(i915, obj->base.size);
 
-		kfree(obj->bit_17);
+		bitmap_free(obj->bit_17);
 		i915_gem_object_free(obj);
 
 		GEM_BUG_ON(!atomic_read(&i915->mm.free_count));
diff --git a/drivers/gpu/drm/i915/i915_gem_fence_reg.c b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
index e037e94792f3..1f880e5b79b0 100644
--- a/drivers/gpu/drm/i915/i915_gem_fence_reg.c
+++ b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
@@ -790,8 +790,7 @@ i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj,
 	int i;
 
 	if (obj->bit_17 == NULL) {
-		obj->bit_17 = kcalloc(BITS_TO_LONGS(page_count),
-				      sizeof(long), GFP_KERNEL);
+		obj->bit_17 = bitmap_zalloc(page_count, GFP_KERNEL);
 		if (obj->bit_17 == NULL) {
 			DRM_ERROR("Failed to allocate memory for bit 17 "
 				  "record\n");
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index 16cc9ddbce34..a9b5329dae3b 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -301,11 +301,11 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj,
 	/* Try to preallocate memory required to save swizzling on put-pages */
 	if (i915_gem_object_needs_bit17_swizzle(obj)) {
 		if (!obj->bit_17) {
-			obj->bit_17 = kcalloc(BITS_TO_LONGS(obj->base.size >> PAGE_SHIFT),
-					      sizeof(long), GFP_KERNEL);
+			obj->bit_17 = bitmap_zalloc(obj->base.size >> PAGE_SHIFT,
+						    GFP_KERNEL);
 		}
 	} else {
-		kfree(obj->bit_17);
+		bitmap_free(obj->bit_17);
 		obj->bit_17 = NULL;
 	}
 
diff --git a/drivers/gpu/drm/i915/selftests/intel_uncore.c b/drivers/gpu/drm/i915/selftests/intel_uncore.c
index 81d9d31042a9..600167ebb303 100644
--- a/drivers/gpu/drm/i915/selftests/intel_uncore.c
+++ b/drivers/gpu/drm/i915/selftests/intel_uncore.c
@@ -137,8 +137,7 @@ static int intel_uncore_check_forcewake_domains(struct drm_i915_private *dev_pri
 	if (!IS_ENABLED(CONFIG_DRM_I915_SELFTEST_BROKEN))
 		return 0;
 
-	valid = kcalloc(BITS_TO_LONGS(FW_RANGE), sizeof(*valid),
-			GFP_KERNEL);
+	valid = bitmap_zalloc(FW_RANGE, GFP_KERNEL);
 	if (!valid)
 		return -ENOMEM;
 
@@ -173,7 +172,7 @@ static int intel_uncore_check_forcewake_domains(struct drm_i915_private *dev_pri
 		}
 	}
 
-	kfree(valid);
+	bitmap_free(valid);
 	return err;
 }
 
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc()
  2019-03-04  9:03 [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc() Andy Shevchenko
  2019-03-04  9:03 ` [PATCH v1 2/2] drm: i915: " Andy Shevchenko
@ 2019-03-04 11:03 ` kbuild test robot
  2019-03-04 11:13 ` kbuild test robot
  2019-03-05  9:28 ` Joonas Lahtinen
  3 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2019-03-04 11:03 UTC (permalink / raw)
  Cc: dri-devel, David Airlie, intel-gfx, kbuild-all, Andy Shevchenko

[-- Attachment #1: Type: text/plain, Size: 4574 bytes --]

Hi Andy,

I love your patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v5.0 next-20190301]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Andy-Shevchenko/drm-selftests-mm-Switch-to-bitmap_zalloc/20190304-183335
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 6.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=6.4.0 make.cross ARCH=nds32 

All error/warnings (new ones prefixed by >>):

   drivers/gpu/drm/selftests/test-drm_mm.c: In function 'igt_bottomup':
>> drivers/gpu/drm/selftests/test-drm_mm.c:1747:11: error: implicit declaration of function 'bitmap_zcalloc' [-Werror=implicit-function-declaration]
     bitmap = bitmap_zcalloc(count, GFP_KERNEL);
              ^~~~~~~~~~~~~~
>> drivers/gpu/drm/selftests/test-drm_mm.c:1747:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     bitmap = bitmap_zcalloc(count, GFP_KERNEL);
            ^
   cc1: some warnings being treated as errors

vim +/bitmap_zcalloc +1747 drivers/gpu/drm/selftests/test-drm_mm.c

  1725	
  1726	static int igt_bottomup(void *ignored)
  1727	{
  1728		const struct insert_mode *bottomup = &insert_modes[BOTTOMUP];
  1729		DRM_RND_STATE(prng, random_seed);
  1730		const unsigned int count = 8192;
  1731		unsigned int size;
  1732		unsigned long *bitmap;
  1733		struct drm_mm mm;
  1734		struct drm_mm_node *nodes, *node, *next;
  1735		unsigned int *order, n, m, o = 0;
  1736		int ret;
  1737	
  1738		/* Like igt_topdown, but instead of searching for the last hole,
  1739		 * we search for the first.
  1740		 */
  1741	
  1742		ret = -ENOMEM;
  1743		nodes = vzalloc(array_size(count, sizeof(*nodes)));
  1744		if (!nodes)
  1745			goto err;
  1746	
> 1747		bitmap = bitmap_zcalloc(count, GFP_KERNEL);
  1748		if (!bitmap)
  1749			goto err_nodes;
  1750	
  1751		order = drm_random_order(count, &prng);
  1752		if (!order)
  1753			goto err_bitmap;
  1754	
  1755		ret = -EINVAL;
  1756		for (size = 1; size <= 64; size <<= 1) {
  1757			drm_mm_init(&mm, 0, size*count);
  1758			for (n = 0; n < count; n++) {
  1759				if (!expect_insert(&mm, &nodes[n],
  1760						   size, 0, n,
  1761						   bottomup)) {
  1762					pr_err("bottomup insert failed, size %u step %d\n", size, n);
  1763					goto out;
  1764				}
  1765	
  1766				if (!assert_one_hole(&mm, size*(n + 1), size*count))
  1767					goto out;
  1768			}
  1769	
  1770			if (!assert_continuous(&mm, size))
  1771				goto out;
  1772	
  1773			drm_random_reorder(order, count, &prng);
  1774			for_each_prime_number_from(n, 1, min(count, max_prime)) {
  1775				for (m = 0; m < n; m++) {
  1776					node = &nodes[order[(o + m) % count]];
  1777					drm_mm_remove_node(node);
  1778					__set_bit(node_index(node), bitmap);
  1779				}
  1780	
  1781				for (m = 0; m < n; m++) {
  1782					unsigned int first;
  1783	
  1784					node = &nodes[order[(o + m) % count]];
  1785					if (!expect_insert(&mm, node,
  1786							   size, 0, 0,
  1787							   bottomup)) {
  1788						pr_err("insert failed, step %d/%d\n", m, n);
  1789						goto out;
  1790					}
  1791	
  1792					first = find_first_bit(bitmap, count);
  1793					if (node_index(node) != first) {
  1794						pr_err("node %d/%d not inserted into bottom hole, expected %d, found %d\n",
  1795						       m, n, first, node_index(node));
  1796						goto out;
  1797					}
  1798					__clear_bit(first, bitmap);
  1799				}
  1800	
  1801				DRM_MM_BUG_ON(find_first_bit(bitmap, count) != count);
  1802	
  1803				o += n;
  1804			}
  1805	
  1806			drm_mm_for_each_node_safe(node, next, &mm)
  1807				drm_mm_remove_node(node);
  1808			DRM_MM_BUG_ON(!drm_mm_clean(&mm));
  1809			cond_resched();
  1810		}
  1811	
  1812		ret = 0;
  1813	out:
  1814		drm_mm_for_each_node_safe(node, next, &mm)
  1815			drm_mm_remove_node(node);
  1816		drm_mm_takedown(&mm);
  1817		kfree(order);
  1818	err_bitmap:
  1819		bitmap_free(bitmap);
  1820	err_nodes:
  1821		vfree(nodes);
  1822	err:
  1823		return ret;
  1824	}
  1825	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 49979 bytes --]

[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc()
  2019-03-04  9:03 [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc() Andy Shevchenko
  2019-03-04  9:03 ` [PATCH v1 2/2] drm: i915: " Andy Shevchenko
  2019-03-04 11:03 ` [PATCH v1 1/2] drm/selftests/mm: " kbuild test robot
@ 2019-03-04 11:13 ` kbuild test robot
  2019-03-05  9:28 ` Joonas Lahtinen
  3 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2019-03-04 11:13 UTC (permalink / raw)
  Cc: dri-devel, David Airlie, intel-gfx, kbuild-all, Andy Shevchenko

[-- Attachment #1: Type: text/plain, Size: 4657 bytes --]

Hi Andy,

I love your patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v5.0 next-20190301]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Andy-Shevchenko/drm-selftests-mm-Switch-to-bitmap_zalloc/20190304-183335
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 8.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.2.0 make.cross ARCH=xtensa 

All error/warnings (new ones prefixed by >>):

   drivers/gpu//drm/selftests/test-drm_mm.c: In function 'igt_bottomup':
>> drivers/gpu//drm/selftests/test-drm_mm.c:1747:11: error: implicit declaration of function 'bitmap_zcalloc'; did you mean 'bitmap_zalloc'? [-Werror=implicit-function-declaration]
     bitmap = bitmap_zcalloc(count, GFP_KERNEL);
              ^~~~~~~~~~~~~~
              bitmap_zalloc
>> drivers/gpu//drm/selftests/test-drm_mm.c:1747:9: warning: assignment to 'long unsigned int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     bitmap = bitmap_zcalloc(count, GFP_KERNEL);
            ^
   cc1: some warnings being treated as errors

vim +1747 drivers/gpu//drm/selftests/test-drm_mm.c

  1725	
  1726	static int igt_bottomup(void *ignored)
  1727	{
  1728		const struct insert_mode *bottomup = &insert_modes[BOTTOMUP];
  1729		DRM_RND_STATE(prng, random_seed);
  1730		const unsigned int count = 8192;
  1731		unsigned int size;
  1732		unsigned long *bitmap;
  1733		struct drm_mm mm;
  1734		struct drm_mm_node *nodes, *node, *next;
  1735		unsigned int *order, n, m, o = 0;
  1736		int ret;
  1737	
  1738		/* Like igt_topdown, but instead of searching for the last hole,
  1739		 * we search for the first.
  1740		 */
  1741	
  1742		ret = -ENOMEM;
  1743		nodes = vzalloc(array_size(count, sizeof(*nodes)));
  1744		if (!nodes)
  1745			goto err;
  1746	
> 1747		bitmap = bitmap_zcalloc(count, GFP_KERNEL);
  1748		if (!bitmap)
  1749			goto err_nodes;
  1750	
  1751		order = drm_random_order(count, &prng);
  1752		if (!order)
  1753			goto err_bitmap;
  1754	
  1755		ret = -EINVAL;
  1756		for (size = 1; size <= 64; size <<= 1) {
  1757			drm_mm_init(&mm, 0, size*count);
  1758			for (n = 0; n < count; n++) {
  1759				if (!expect_insert(&mm, &nodes[n],
  1760						   size, 0, n,
  1761						   bottomup)) {
  1762					pr_err("bottomup insert failed, size %u step %d\n", size, n);
  1763					goto out;
  1764				}
  1765	
  1766				if (!assert_one_hole(&mm, size*(n + 1), size*count))
  1767					goto out;
  1768			}
  1769	
  1770			if (!assert_continuous(&mm, size))
  1771				goto out;
  1772	
  1773			drm_random_reorder(order, count, &prng);
  1774			for_each_prime_number_from(n, 1, min(count, max_prime)) {
  1775				for (m = 0; m < n; m++) {
  1776					node = &nodes[order[(o + m) % count]];
  1777					drm_mm_remove_node(node);
  1778					__set_bit(node_index(node), bitmap);
  1779				}
  1780	
  1781				for (m = 0; m < n; m++) {
  1782					unsigned int first;
  1783	
  1784					node = &nodes[order[(o + m) % count]];
  1785					if (!expect_insert(&mm, node,
  1786							   size, 0, 0,
  1787							   bottomup)) {
  1788						pr_err("insert failed, step %d/%d\n", m, n);
  1789						goto out;
  1790					}
  1791	
  1792					first = find_first_bit(bitmap, count);
  1793					if (node_index(node) != first) {
  1794						pr_err("node %d/%d not inserted into bottom hole, expected %d, found %d\n",
  1795						       m, n, first, node_index(node));
  1796						goto out;
  1797					}
  1798					__clear_bit(first, bitmap);
  1799				}
  1800	
  1801				DRM_MM_BUG_ON(find_first_bit(bitmap, count) != count);
  1802	
  1803				o += n;
  1804			}
  1805	
  1806			drm_mm_for_each_node_safe(node, next, &mm)
  1807				drm_mm_remove_node(node);
  1808			DRM_MM_BUG_ON(!drm_mm_clean(&mm));
  1809			cond_resched();
  1810		}
  1811	
  1812		ret = 0;
  1813	out:
  1814		drm_mm_for_each_node_safe(node, next, &mm)
  1815			drm_mm_remove_node(node);
  1816		drm_mm_takedown(&mm);
  1817		kfree(order);
  1818	err_bitmap:
  1819		bitmap_free(bitmap);
  1820	err_nodes:
  1821		vfree(nodes);
  1822	err:
  1823		return ret;
  1824	}
  1825	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 56366 bytes --]

[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc()
  2019-03-04  9:03 [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc() Andy Shevchenko
                   ` (2 preceding siblings ...)
  2019-03-04 11:13 ` kbuild test robot
@ 2019-03-05  9:28 ` Joonas Lahtinen
  2019-03-05 10:20   ` Andy Shevchenko
  3 siblings, 1 reply; 7+ messages in thread
From: Joonas Lahtinen @ 2019-03-05  9:28 UTC (permalink / raw)
  To: Daniel Vetter, David Airlie, Jani Nikula, Rodrigo Vivi, dri-devel,
	intel-gfx
  Cc: Andy Shevchenko

I take it that both instances are supposed to call bitmap_zalloc?

If you can send a v2 that compiles, I can merge it after it passes the
CI.

Regards, Joonas

Quoting Andy Shevchenko (2019-03-04 11:03:20)
> Switch to bitmap_zalloc() to show clearly what we are allocating.
> Besides that it returns pointer of bitmap type instead of opaque void *.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpu/drm/selftests/test-drm_mm.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c
> index fbed2c90fd51..d1206aef26af 100644
> --- a/drivers/gpu/drm/selftests/test-drm_mm.c
> +++ b/drivers/gpu/drm/selftests/test-drm_mm.c
> @@ -1615,7 +1615,7 @@ static int igt_topdown(void *ignored)
>         DRM_RND_STATE(prng, random_seed);
>         const unsigned int count = 8192;
>         unsigned int size;
> -       unsigned long *bitmap = NULL;
> +       unsigned long *bitmap;
>         struct drm_mm mm;
>         struct drm_mm_node *nodes, *node, *next;
>         unsigned int *order, n, m, o = 0;
> @@ -1631,8 +1631,7 @@ static int igt_topdown(void *ignored)
>         if (!nodes)
>                 goto err;
>  
> -       bitmap = kcalloc(count / BITS_PER_LONG, sizeof(unsigned long),
> -                        GFP_KERNEL);
> +       bitmap = bitmap_zalloc(count, GFP_KERNEL);
>         if (!bitmap)
>                 goto err_nodes;
>  
> @@ -1717,7 +1716,7 @@ static int igt_topdown(void *ignored)
>         drm_mm_takedown(&mm);
>         kfree(order);
>  err_bitmap:
> -       kfree(bitmap);
> +       bitmap_free(bitmap);
>  err_nodes:
>         vfree(nodes);
>  err:
> @@ -1745,8 +1744,7 @@ static int igt_bottomup(void *ignored)
>         if (!nodes)
>                 goto err;
>  
> -       bitmap = kcalloc(count / BITS_PER_LONG, sizeof(unsigned long),
> -                        GFP_KERNEL);
> +       bitmap = bitmap_zcalloc(count, GFP_KERNEL);
>         if (!bitmap)
>                 goto err_nodes;
>  
> @@ -1818,7 +1816,7 @@ static int igt_bottomup(void *ignored)
>         drm_mm_takedown(&mm);
>         kfree(order);
>  err_bitmap:
> -       kfree(bitmap);
> +       bitmap_free(bitmap);
>  err_nodes:
>         vfree(nodes);
>  err:
> -- 
> 2.20.1
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc()
  2019-03-05  9:28 ` Joonas Lahtinen
@ 2019-03-05 10:20   ` Andy Shevchenko
  2019-03-05 10:22     ` Chris Wilson
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2019-03-05 10:20 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: David Airlie, intel-gfx, dri-devel

On Tue, Mar 05, 2019 at 11:28:36AM +0200, Joonas Lahtinen wrote:
> I take it that both instances are supposed to call bitmap_zalloc?
> 
> If you can send a v2 that compiles, I can merge it after it passes the
> CI.

v2 had been sent yesterday.

-- 
With Best Regards,
Andy Shevchenko


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc()
  2019-03-05 10:20   ` Andy Shevchenko
@ 2019-03-05 10:22     ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-03-05 10:22 UTC (permalink / raw)
  To: Andy Shevchenko, Joonas Lahtinen; +Cc: David Airlie, intel-gfx, dri-devel

Quoting Andy Shevchenko (2019-03-05 10:20:31)
> On Tue, Mar 05, 2019 at 11:28:36AM +0200, Joonas Lahtinen wrote:
> > I take it that both instances are supposed to call bitmap_zalloc?
> > 
> > If you can send a v2 that compiles, I can merge it after it passes the
> > CI.
> 
> v2 had been sent yesterday.
https://patchwork.freedesktop.org/series/57507/
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-05 10:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-04  9:03 [PATCH v1 1/2] drm/selftests/mm: Switch to bitmap_zalloc() Andy Shevchenko
2019-03-04  9:03 ` [PATCH v1 2/2] drm: i915: " Andy Shevchenko
2019-03-04 11:03 ` [PATCH v1 1/2] drm/selftests/mm: " kbuild test robot
2019-03-04 11:13 ` kbuild test robot
2019-03-05  9:28 ` Joonas Lahtinen
2019-03-05 10:20   ` Andy Shevchenko
2019-03-05 10:22     ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox