Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1522203 - Remove Pentium Pro workaround for PK11_GetAllTokens r=k…
…jacobs

The comment indicated the wasted effort was to work around a cache issue on the
Pentium Pro. I think it has served its purpose.

Differential Revision: https://phabricator.services.mozilla.com/D54337

--HG--
extra : moz-landing-system : lando
  • Loading branch information
jcjones committed Nov 22, 2019
1 parent 4c2f7d5 commit 6afafd7
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/pk11wrap/pk11slot.c
Expand Up @@ -2177,10 +2177,6 @@ PK11_GetAllTokens(CK_MECHANISM_TYPE type, PRBool needRW, PRBool loadCerts,
SECMODModuleList *modules;
SECMODListLock *moduleLock;
int i;
#if defined(XP_WIN32)
int j = 0;
PRInt32 waste[16];
#endif

moduleLock = SECMOD_GetDefaultModuleListLock();
if (!moduleLock) {
Expand All @@ -2205,18 +2201,6 @@ PK11_GetAllTokens(CK_MECHANISM_TYPE type, PRBool needRW, PRBool loadCerts,

modules = SECMOD_GetDefaultModuleList();
for (mlp = modules; mlp != NULL; mlp = mlp->next) {

#if defined(XP_WIN32)
/* This is works around some horrible cache/page thrashing problems
** on Win32. Without this, this loop can take up to 6 seconds at
** 100% CPU on a Pentium-Pro 200. The thing this changes is to
** increase the size of the stack frame and modify it.
** Moving the loop code itself seems to have no effect.
** Dunno why this combination makes a difference, but it does.
*/
waste[j & 0xf] = j++;
#endif

for (i = 0; i < mlp->module->slotCount; i++) {
PK11SlotInfo *slot = mlp->module->slots[i];

Expand Down

0 comments on commit 6afafd7

Please sign in to comment.