Re: [PATCH] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal
From: Nathan Lynch <hidden>
Date: 2020-08-12 01:34:48
From: Nathan Lynch <hidden>
Date: 2020-08-12 01:34:48
Nathan Lynch [off-list ref] writes:
Michael Ellerman [off-list ref] writes:quoted
One thought, which I possibly should not put in writing, is that we could use the alignment of the pointer as a poor man's substitute for a counter, eg: +static inline struct drmem_lmb *drmem_lmb_next(struct drmem_lmb *lmb) +{ + if (lmb % PAGE_SIZE == 0) + cond_resched(); + + return ++lmb; +} I think the lmbs are allocated in a block, so I think that will work. Maybe PAGE_SIZE is not the right size to use, but you get the idea. Gross I know, but might be OK as short term solution?OK, looking into this.
To follow up: I wasn't able to measure more than ~1% difference in DLPAR memory performance with my original version of this, but that was on a relatively small configuration - hundreds of elements in the array as opposed to thousands. I took an educated guess at an appropriate interval and posted v2: https://lore.kernel.org/linuxppc-dev/20200812012005.1919255-1-nathanl@linux.ibm.com/ (local)