"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stress-vm.c" between
stress-ng-0.13.04.tar.xz and stress-ng-0.13.05.tar.xz

About: stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.

stress-vm.c  (stress-ng-0.13.04.tar.xz):stress-vm.c  (stress-ng-0.13.05.tar.xz)
skipping to change at line 1973 skipping to change at line 1973
} }
add_counter(args, VM_ROWHAMMER_LOOPS); add_counter(args, VM_ROWHAMMER_LOOPS);
val = (val >> 31) | (val << 1); val = (val >> 31) | (val << 1);
stress_vm_check("rowhammer", bit_errors); stress_vm_check("rowhammer", bit_errors);
return bit_errors; return bit_errors;
} }
/* /*
* stress_vm_popcount()
* population count - count number of 1 bits in val (K & R method)
*/
static inline unsigned int OPTIMIZE3 stress_vm_popcount(register uint8_t val)
{
register unsigned int count;
for (count = 0; val; count++)
val &= val - 1;
return count;
}
/*
* stress_vm_mscan()
* for each byte, walk through each bit set to 0, check, set to 1, check
*/
static size_t TARGET_CLONES stress_vm_mscan(
void *buf,
void *buf_end,
const size_t sz,
const stress_args_t *args,
const uint64_t max_ops)
{
size_t bit_errors = 0;
volatile uint8_t *ptr = (volatile uint8_t *)buf, *end;
uint64_t c = get_counter(args);
(void)sz;
for (ptr = (volatile uint8_t *)buf; ptr < (uint8_t *)buf_end; ptr++, c++)
{
*ptr |= 0x01;
*ptr |= 0x02;
*ptr |= 0x04;
*ptr |= 0x08;
*ptr |= 0x10;
*ptr |= 0x20;
*ptr |= 0x40;
*ptr |= 0x80;
if (UNLIKELY(!keep_stressing_flag() || (max_ops && (c >= max_ops)
)))
break;
}
end = (volatile uint8_t *)ptr;
add_counter(args, c);
for (ptr = (volatile uint8_t *)buf; ptr < end; ptr++) {
bit_errors += 8 - stress_vm_popcount(*ptr);
}
for (ptr = (volatile uint8_t *)buf; ptr < (uint8_t *)buf_end; ptr++, c++)
{
*ptr &= 0xfe;
*ptr &= 0xfd;
*ptr &= 0xfb;
*ptr &= 0xf7;
*ptr &= 0xef;
*ptr &= 0xdf;
*ptr &= 0xbf;
*ptr &= 0x7f;
if (UNLIKELY(!keep_stressing_flag() || (max_ops && (c >= max_ops)
)))
break;
}
end = (volatile uint8_t *)ptr;
add_counter(args, c);
for (ptr = (volatile uint8_t *)buf; ptr < end; ptr++) {
bit_errors += stress_vm_popcount(*ptr);
}
stress_vm_check("mscan", bit_errors);
set_counter(args, c);
return bit_errors;
}
/*
* stress_vm_all() * stress_vm_all()
* work through all vm stressors sequentially * work through all vm stressors sequentially
*/ */
static size_t stress_vm_all( static size_t stress_vm_all(
void *buf, void *buf,
void *buf_end, void *buf_end,
const size_t sz, const size_t sz,
const stress_args_t *args, const stress_args_t *args,
const uint64_t max_ops) const uint64_t max_ops)
{ {
skipping to change at line 2010 skipping to change at line 2089
{ "rowhammer", stress_vm_rowhammer }, { "rowhammer", stress_vm_rowhammer },
{ "incdec", stress_vm_incdec }, { "incdec", stress_vm_incdec },
{ "inc-nybble", stress_vm_inc_nybble }, { "inc-nybble", stress_vm_inc_nybble },
{ "rand-set", stress_vm_rand_set }, { "rand-set", stress_vm_rand_set },
{ "rand-sum", stress_vm_rand_sum }, { "rand-sum", stress_vm_rand_sum },
{ "read64", stress_vm_read64 }, { "read64", stress_vm_read64 },
{ "ror", stress_vm_ror }, { "ror", stress_vm_ror },
{ "swap", stress_vm_swap }, { "swap", stress_vm_swap },
{ "move-inv", stress_vm_moving_inversion }, { "move-inv", stress_vm_moving_inversion },
{ "modulo-x", stress_vm_modulo_x }, { "modulo-x", stress_vm_modulo_x },
{ "mscan", stress_vm_mscan },
{ "prime-0", stress_vm_prime_zero }, { "prime-0", stress_vm_prime_zero },
{ "prime-1", stress_vm_prime_one }, { "prime-1", stress_vm_prime_one },
{ "prime-gray-0",stress_vm_prime_gray_zero }, { "prime-gray-0",stress_vm_prime_gray_zero },
{ "prime-gray-1",stress_vm_prime_gray_one }, { "prime-gray-1",stress_vm_prime_gray_one },
{ "prime-incdec",stress_vm_prime_incdec }, { "prime-incdec",stress_vm_prime_incdec },
{ "walk-0d", stress_vm_walking_zero_data }, { "walk-0d", stress_vm_walking_zero_data },
{ "walk-1d", stress_vm_walking_one_data }, { "walk-1d", stress_vm_walking_one_data },
{ "walk-0a", stress_vm_walking_zero_addr }, { "walk-0a", stress_vm_walking_zero_addr },
{ "walk-1a", stress_vm_walking_one_addr }, { "walk-1a", stress_vm_walking_one_addr },
{ "write64", stress_vm_write64 }, { "write64", stress_vm_write64 },
 End of changes. 2 change blocks. 
0 lines changed or deleted 84 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)