linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the akpm-current tree with the xarray tree
@ 2018-10-02  7:27 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2018-10-02  7:27 UTC (permalink / raw)
  To: Andrew Morton, Matthew Wilcox
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, zhong jiang

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

Hi all,

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

  include/linux/radix-tree.h

between commit:

  be18dc56ed20 ("xarray: Define struct xa_node")

from the xarray tree and commit:

  e4618700a039 ("include/linux/radix-tree.h: use DIV_ROUND_UP instead of reimplementing its function")

from the akpm-current tree.

I fixed it up (I just used ther former version) 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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* linux-next: manual merge of the akpm-current tree with the xarray tree
@ 2018-10-02  7:39 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2018-10-02  7:39 UTC (permalink / raw)
  To: Andrew Morton, Matthew Wilcox
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Johannes Weiner

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

Hi all,

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

  mm/workingset.c

between commit:

  3159f943aafd ("xarray: Replace exceptional entries")
  bb7bbd491985 ("mm: Convert workingset to XArray")

from the xarray tree and commit:

  2685383fce55 ("mm: workingset: don't drop refault information prematurely")
  544eea1cbede ("mm: workingset: tell cache transitions from workingset thrashing")

from the akpm-current tree.

I fixed it up (hopefully - 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 mm/workingset.c
index 5cfb29ec3fd9,c3a9bb797b6d..000000000000
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@@ -155,9 -167,8 +167,8 @@@
   * refault distance will immediately activate the refaulting page.
   */
  
 -#define EVICTION_SHIFT	(RADIX_TREE_EXCEPTIONAL_ENTRY + \
 +#define EVICTION_SHIFT	((BITS_PER_LONG - BITS_PER_XA_VALUE) +	\
- 			 NODES_SHIFT +				\
- 			 MEM_CGROUP_ID_SHIFT)
+ 			 1 + NODES_SHIFT + MEM_CGROUP_ID_SHIFT)
  #define EVICTION_MASK	(~0UL >> EVICTION_SHIFT)
  
  /*
@@@ -170,22 -181,28 +181,27 @@@
   */
  static unsigned int bucket_order __read_mostly;
  
- static void *pack_shadow(int memcgid, pg_data_t *pgdat, unsigned long eviction)
+ static void *pack_shadow(int memcgid, pg_data_t *pgdat, unsigned long eviction,
+ 			 bool workingset)
  {
  	eviction >>= bucket_order;
 +	eviction &= EVICTION_MASK;
  	eviction = (eviction << MEM_CGROUP_ID_SHIFT) | memcgid;
  	eviction = (eviction << NODES_SHIFT) | pgdat->node_id;
+ 	eviction = (eviction << 1) | workingset;
 -	eviction = (eviction << RADIX_TREE_EXCEPTIONAL_SHIFT);
  
 -	return (void *)(eviction | RADIX_TREE_EXCEPTIONAL_ENTRY);
 +	return xa_mk_value(eviction);
  }
  
  static void unpack_shadow(void *shadow, int *memcgidp, pg_data_t **pgdat,
- 			  unsigned long *evictionp)
+ 			  unsigned long *evictionp, bool *workingsetp)
  {
 -	unsigned long entry = (unsigned long)shadow;
 +	unsigned long entry = xa_to_value(shadow);
  	int memcgid, nid;
+ 	bool workingset;
  
 -	entry >>= RADIX_TREE_EXCEPTIONAL_SHIFT;
+ 	workingset = entry & 1;
+ 	entry >>= 1;
  	nid = entry & ((1UL << NODES_SHIFT) - 1);
  	entry >>= NODES_SHIFT;
  	memcgid = entry & ((1UL << MEM_CGROUP_ID_SHIFT) - 1);
@@@ -387,16 -415,16 +414,16 @@@ static unsigned long count_shadow_nodes
  	 * each, this will reclaim shadow entries when they consume
  	 * ~1.8% of available memory:
  	 *
 -	 * PAGE_SIZE / radix_tree_nodes / node_entries * 8 / PAGE_SIZE
 +	 * PAGE_SIZE / xa_nodes / node_entries * 8 / PAGE_SIZE
  	 */
- 	if (sc->memcg) {
- 		cache = mem_cgroup_node_nr_lru_pages(sc->memcg, sc->nid,
- 						     LRU_ALL_FILE);
- 	} else {
- 		cache = node_page_state(NODE_DATA(sc->nid), NR_ACTIVE_FILE) +
- 			node_page_state(NODE_DATA(sc->nid), NR_INACTIVE_FILE);
- 	}
- 	max_nodes = cache >> (XA_CHUNK_SHIFT - 3);
+ #ifdef CONFIG_MEMCG
+ 	if (sc->memcg)
+ 		pages = page_counter_read(&sc->memcg->memory);
+ 	else
+ #endif
+ 		pages = node_present_pages(sc->nid);
+ 
 -	max_nodes = pages >> (RADIX_TREE_MAP_SHIFT - 3);
++	max_nodes = pages >> (XA_CHUNK_SHIFT - 3);
  
  	if (!nodes)
  		return SHRINK_EMPTY;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2018-10-02  7:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02  7:27 linux-next: manual merge of the akpm-current tree with the xarray tree Stephen Rothwell
2018-10-02  7:39 Stephen Rothwell

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).