This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Improve random memcpy benchmark
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Paul Clarke <pc at us dot ibm dot com>, 'GNU C Library' <libc-alpha at sourceware dot org>
- Date: Wed, 12 Feb 2020 15:43:33 +0000
- Subject: Re: [PATCH] Improve random memcpy benchmark
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yxfBB0mLYpYnC5D4onWksakQINryxpM4goroNpKbCU0=; b=nJH32Ji/YBC1+dY7BFdz0Y+1eHu08aMDXT0yl9aTahvWDjH4rlxW2bHSt3uO91U7lhOdvlsVfvyH56aDZT3APmACB4ksaeLQgKRKWH0yQ4CAaJ/N58JZKw5BFg41LtnbxPScWp9V+fHjp9ZHfeVO+LEZ+XO1nx6t1abj3k/Zw8tM20IALVj8to3VKjIC30LCFlcLKJwdgLVJlVWYuYDFO81fd94GjwNHOBVkgpzH+sdSSKsjL9ikcgyrSfq3Yocw8t1ZDCzTZi68YwRMoRlIMF9iWlfnWKvg7PqoyrKOLOvpERlfytAyAljvpFLkLryPH+gJi3lEKercur+x2SJxEA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BPtUMwQkBMDKk8U8/zaXD7tOgbFKdPzY57BGiKGHPX+FRPXvCNjiYrvsoocbXY6TJCHJEWp/LMoPa6W/0t45Uz88xIOqXs8N6Eo+iZjv+OFi29hsJMv+prY0r6QuuZwvr7DFnsplKm0/dEDSob/XLCjgzZzzCo54WDuFBY73pM3Y5BemQnbJRU4OVrc9fYpsDaWi/shjR65mBWuIsFPhe3Coatq4iXfnn9viEjTSMFRVe45c9iHbL5TZZhEFlF+O9ZoyMWNIL4fmz4Y+z7jV8BAGFEwjKai2zWqhH3j1aYSL8CpGDLm73egVJDqvI4t9bjpdcbZBgnxj6QHfMbvOwQ==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
- References: <AM5PR0801MB2035060A16DE804C88C3AB5083190@AM5PR0801MB2035.eurprd08.prod.outlook.com> <0f5db76f-2520-0409-86ea-1f2932b30ba5@us.ibm.com> <AM5PR0801MB2035026BE64A38E3C3556D0283180@AM5PR0801MB2035.eurprd08.prod.outlook.com>,<160e1132-f931-8afb-eee5-ea58c9a4f468@us.ibm.com>
Hi Paul,
> At least some of the tests do attempt to align to a page boundary, like in
> benchtests/bench-strcmp.c:
/* Put them close to the end of page. */
i = align1 + CHARBYTES * (len + 2);
s1 = (CHAR *) (buf1 + ((page_size - i) / 16 * 16) + align1);
i = align2 + CHARBYTES * (len + 2);
s2 = (CHAR *) (buf2 + ((page_size - i) / 16 * 16) + align2);
Those tests won't do anything useful given the way page_size is used.
> So modifying MIN_PAGE_SIZE so that it's definitely not a multiple of any page size
> except 4096 might have some unexpected impact.
Not on that test, it's broken now and remains broken after my change (which
is in a different benchmark, unrelated to other tests).
> If the +4096 isn't needed, why add it?
It's the correct size to allocate - the 4096 isn't related to the page size but to the
maximum memcpy size used.
> Or, do page size correctly. There are operations which are sensitive to page
> boundaries that need to be tested.
Yes, fixing that would require cleaning up the way page_size is used.
> I understand the current code may not do page size correctly. It doesn't.
> But, I think we should keep the implementation close to the original intent
> until it is cleaned up properly.
Yes that's why I just modified the define - the current meaning is unrelated
to page size and just indicates how much memory to allocate.
Cheers,
Wilco