Skip to content

Commit

Permalink
Allow building with CFLAGS="-O0"
Browse files Browse the repository at this point in the history
If compiled with -O0, gcc doesn't do any stack frame coalescing
and -Wframe-larger-than=1024 is triggered in debug mode.
Starting with gcc 4.8, new opt level -Og is introduced for debugging, which
does not trigger this warning.

Fix bench zio size, using SPA_OLD_MAXBLOCKSHIFT

Issue openzfs#4799

Signed-off-by: Gvozden Neskovic <[email protected]>
  • Loading branch information
ironMann committed Jul 11, 2016
1 parent 5c27b29 commit 5ea857b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/vdev_raidz_math.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ init_raidz_kstat(raidz_impl_kstat_t *rs, const char *name)

#define BENCH_D_COLS (8ULL)
#define BENCH_COLS (BENCH_D_COLS + PARITY_PQR)
#define BENCH_ZIO_SIZE (2ULL << 17) /* 128 kiB */
#define BENCH_ZIO_SIZE (1ULL << SPA_OLD_MAXBLOCKSHIFT) /* 128 kiB */
#define BENCH_NS MSEC2NSEC(25) /* 25ms */

typedef void (*benchmark_fn)(raidz_map_t *rm, const int fn);
Expand Down
8 changes: 8 additions & 0 deletions module/zfs/vdev_raidz_math_scalar.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ static const struct {

#include "vdev_raidz_math_impl.h"

/*
* If compiled with -O0, gcc doesn't do any stack frame coalescing
* and -Wframe-larger-than=1024 is triggered in debug mode.
* Starting with gcc 4.8, new opt level -Og is introduced for debugging, which
* does not trigger this warning.
*/
#pragma GCC diagnostic ignored "-Wframe-larger-than="

DEFINE_GEN_METHODS(scalar);
DEFINE_REC_METHODS(scalar);

Expand Down

0 comments on commit 5ea857b

Please sign in to comment.