Skip to content

Commit

Permalink
common: fix libpmem CFLAGS
Browse files Browse the repository at this point in the history
For libpmem CFLAGS are set before the src/Makefile.inc is included.
As far as I can tell it was unintentionally introduced by #4797.
This oversight excluded libpmem from using DEFAULT_CFLAGS. Which has
significant consequences on the outcome e.g. restoring the use of
DEFAULT_CFLAGS reduces the maximum stack usage from 50kB to 8kB.

The issue is present in releases >= 1.9. Note that non-NDCTL builds
were not affected.

This regression although unintentional might had a not yet known
influence on the performance.

Signed-off-by: Jan Michalski <jan.michalski@intel.com>
  • Loading branch information
janekmi committed Oct 24, 2023
1 parent 069efd7 commit be8657f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* Unreleased *

This release:
- ...
- Significantly reduces the libpmem's stack usage.

Tue Aug 8 2023 Oksana Sałyk <oksana.salyk@intel.com>

Expand Down
3 changes: 3 additions & 0 deletions src/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# src/Makefile.inc -- common Makefile rules for PMDK
#

# Note: Please do not set CFLAGS before this file is included unless you do not
# want to use default CFLAGS.

TOP := $(dir $(lastword $(MAKEFILE_LIST)))..

include $(TOP)/src/common.inc
Expand Down
6 changes: 2 additions & 4 deletions src/libpmem/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ ifeq ($(OS_DIMM),ndctl)
SOURCE +=\
region_namespace_ndctl.c\
numa_ndctl.c
CFLAGS += $(LIBNDCTL_CFLAGS)
LIBS += $(LIBNDCTL_LIBS)
else
SOURCE +=\
region_namespace_none.c\
Expand All @@ -68,5 +66,5 @@ include ../Makefile.inc

include $(PMEM2)/$(ARCH)/flags.inc

CFLAGS += -I.
LIBS += -pthread
CFLAGS += -I. $(LIBNDCTL_CFLAGS)
LIBS += -pthread $(LIBNDCTL_LIBS)

0 comments on commit be8657f

Please sign in to comment.