History

md/raid6: fix algorithm choice under larger PAGE_SIZE

There are several algorithms available for raid6 to generate xor and syndrome parity, including basic int1, int2 ... int32 and SIMD optimized implementation like sse and neon. To test and choose the best algorithms at the initial stage, we need provide enough disk data to feed the algorithms. However, the disk number we provided depends on page size and gfmul table, seeing bellow: const int disks = (65536/PAGE_SIZE) + 2; So when come to 64K PAGE_SIZE, there is only one data disk plus 2 parity disk, as a result the chosed algorithm is not reliable. For example, on my arm64 machine with 64K page enabled, it will choose intx32 as the best one, although the NEON implementation is better. This patch tries to fix the problem by defining a constant raid6 disk number to supporting arbitrary page size.

Zhengyuan Liu committed 6 years ago

Commit f591df31 parent 5e5ac012 files · +44 −23Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/raid/pq.h+4−0
@@ -28,6 +28,7 @@ extern const char raid6_empty_zero_page[PAGE_SIZE]; · 27 unmodified lines
28#include <errno.h>28#include <errno.h>
29#include <inttypes.h>29#include <inttypes.h>
30#include <stddef.h>30#include <stddef.h>
31#include <string.h>
31#include <sys/mman.h>32#include <sys/mman.h>
32#include <sys/time.h>33#include <sys/time.h>
33#include <sys/types.h>34#include <sys/types.h>
@@ -43,6 +44,9 @@ typedef uint64_t u64; · 9 unmodified lines
43#ifndef PAGE_SIZE44#ifndef PAGE_SIZE
44# define PAGE_SIZE 409645# define PAGE_SIZE 4096
45#endif46#endif
47#ifndef PAGE_SHIFT
48# define PAGE_SHIFT 12
49#endif
46extern const char raid6_empty_zero_page[PAGE_SIZE];50extern const char raid6_empty_zero_page[PAGE_SIZE];
47 51
48#define __init52#define __init

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t