linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Dave Airlie <airlied@linux.ie>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Michel Dänzer" <michel.daenzer@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>
Subject: linux-next: manual merge of the tip tree with the drm tree
Date: Wed, 1 Feb 2017 14:38:25 +1100	[thread overview]
Message-ID: <20170201143825.43aa2f7a@canb.auug.org.au> (raw)

Hi all,

Today's linux-next merge of the tip tree got a conflict in:

  drivers/gpu/drm/ttm/ttm_bo.c

between commit:

  239ac65fa5ff ("drm/ttm: Make sure BOs being swapped out are cacheable")

from the drm tree and commit:

  bdfafc4ffdd2 ("locking/atomic, kref: Kill kref_sub()")
  cf6c467d67d3 ("drm/ttm: add BO priorities for the LRUs")
  896d630d240e ("drm/ttm: revert "add optional LRU removal callback v2"")

from the tip tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/ttm/ttm_bo.c
index 4562e53c8244,ffc6cb55c78c..000000000000
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@@ -184,37 -181,26 +184,26 @@@ void ttm_bo_add_to_lru(struct ttm_buffe
  }
  EXPORT_SYMBOL(ttm_bo_add_to_lru);
  
- int ttm_bo_del_from_lru(struct ttm_buffer_object *bo)
+ static void ttm_bo_ref_bug(struct kref *list_kref)
  {
- 	int put_count = 0;
+ 	BUG();
+ }
  
+ void ttm_bo_del_from_lru(struct ttm_buffer_object *bo)
+ {
 -	struct ttm_bo_device *bdev = bo->bdev;
 -
 -	if (bdev->driver->lru_removal)
 -		bdev->driver->lru_removal(bo);
 -
  	if (!list_empty(&bo->swap)) {
  		list_del_init(&bo->swap);
- 		++put_count;
+ 		kref_put(&bo->list_kref, ttm_bo_ref_bug);
  	}
  	if (!list_empty(&bo->lru)) {
  		list_del_init(&bo->lru);
- 		++put_count;
+ 		kref_put(&bo->list_kref, ttm_bo_ref_bug);
  	}
 +
 +	/*
 +	 * TODO: Add a driver hook to delete from
 +	 * driver-specific LRU's here.
 +	 */
- 
- 	return put_count;
- }
- 
- static void ttm_bo_ref_bug(struct kref *list_kref)
- {
- 	BUG();
- }
- 
- void ttm_bo_list_ref_sub(struct ttm_buffer_object *bo, int count,
- 			 bool never_free)
- {
- 	kref_sub(&bo->list_kref, count,
- 		 (never_free) ? ttm_bo_ref_bug : ttm_bo_release_list);
  }
  
  void ttm_bo_del_sub_from_lru(struct ttm_buffer_object *bo)
@@@ -230,12 -213,14 +216,9 @@@ EXPORT_SYMBOL(ttm_bo_del_sub_from_lru)
  
  void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo)
  {
- 	int put_count = 0;
 -	struct ttm_bo_device *bdev = bo->bdev;
--
  	lockdep_assert_held(&bo->resv->lock.base);
  
- 	put_count = ttm_bo_del_from_lru(bo);
- 	ttm_bo_list_ref_sub(bo, put_count, true);
 -	if (bdev->driver->lru_removal)
 -		bdev->driver->lru_removal(bo);
 -
+ 	ttm_bo_del_from_lru(bo);
  	ttm_bo_add_to_lru(bo);
  }
  EXPORT_SYMBOL(ttm_bo_move_to_lru_tail);
@@@ -728,28 -718,21 +704,28 @@@ static int ttm_mem_evict_first(struct t
  	struct ttm_bo_global *glob = bdev->glob;
  	struct ttm_mem_type_manager *man = &bdev->man[mem_type];
  	struct ttm_buffer_object *bo;
- 	int ret = -EBUSY, put_count;
+ 	int ret = -EBUSY;
 +	unsigned i;
  
  	spin_lock(&glob->lru_lock);
 -	list_for_each_entry(bo, &man->lru, lru) {
 -		ret = __ttm_bo_reserve(bo, false, true, NULL);
 -		if (ret)
 -			continue;
 +	for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
 +		list_for_each_entry(bo, &man->lru[i], lru) {
 +			ret = __ttm_bo_reserve(bo, false, true, NULL);
 +			if (ret)
 +				continue;
  
 -		if (place && !bdev->driver->eviction_valuable(bo, place)) {
 -			__ttm_bo_unreserve(bo);
 -			ret = -EBUSY;
 -			continue;
 +			if (place && !bdev->driver->eviction_valuable(bo,
 +								      place)) {
 +				__ttm_bo_unreserve(bo);
 +				ret = -EBUSY;
 +				continue;
 +			}
 +
 +			break;
  		}
  
 -		break;
 +		if (!ret)
 +			break;
  	}
  
  	if (ret) {
@@@ -1667,16 -1645,11 +1641,15 @@@ static int ttm_bo_swapout(struct ttm_me
  	    container_of(shrink, struct ttm_bo_global, shrink);
  	struct ttm_buffer_object *bo;
  	int ret = -EBUSY;
- 	int put_count;
 -	uint32_t swap_placement = (TTM_PL_FLAG_CACHED | TTM_PL_FLAG_SYSTEM);
 +	unsigned i;
  
  	spin_lock(&glob->lru_lock);
 -	list_for_each_entry(bo, &glob->swap_lru, swap) {
 -		ret = __ttm_bo_reserve(bo, false, true, NULL);
 +	for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
 +		list_for_each_entry(bo, &glob->swap_lru[i], swap) {
 +			ret = __ttm_bo_reserve(bo, false, true, NULL);
 +			if (!ret)
 +				break;
 +		}
  		if (!ret)
  			break;
  	}

             reply	other threads:[~2017-02-01  3:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01  3:38 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-04-11  3:59 linux-next: manual merge of the tip tree with the drm tree Stephen Rothwell
2019-11-27  0:18 Stephen Rothwell
2019-10-10  1:51 Stephen Rothwell
2019-11-27 23:36 ` Stephen Rothwell
2017-02-17  1:56 Stephen Rothwell
2016-11-17  2:59 Stephen Rothwell
2016-03-17  2:00 Stephen Rothwell
2016-03-17  9:00 ` Arnd Bergmann
2016-03-17  9:39   ` Stephen Rothwell
2016-03-17 16:52   ` Dave Hansen
2014-03-24  3:38 Stephen Rothwell
2012-03-13  5:11 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170201143825.43aa2f7a@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=michel.daenzer@amd.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).