On 26/07/18 20:05, Florian Weimer wrote: > * Andrew Dinn: > >>> + // TODO - remove the following defines >>> + // for testing we need to define the extra MAP_XXX flags used for >>> + // persistent memory. they will eventually get defined by the >>> + // system and included via sys/mman.h >>> >>> Do you really want to change implementation behavior based on which >>> glibc headers (or kernel headers) were used to build the JDK? It's >>> likely more appropriate to define the constants yourself if they are >>> not available. There is some architecture variance for the MAP_* >>> constants, but in case of MAP_SHARED_VALIDATE, even HPPA has the same >>> definition. >> >> No, I guess I don't really want to change implementation behaviour based >> on which glibc headers (or kernel headers) were used to build the JDK. >> So, I think I need to modify this so the constants are always defined by >> FileChannelImpl.c >> >> I have followed the Intel libpmem code in defining the values for these >> constants. Can you provide details of the 'architecture variance' you >> refer to above? > > Just a quick note on that: Some of the constants in <sys/mman.h> vary > between the Linux architectures for historic reasons. However, for > MAP_SHARED_VALIDATE, the constant is consistent across all > architectures supported by glibc and in the mainline kernel. > > You could add something like this to be on the safe side: > > #ifdef MAP_SHARED_VALIDATE > #if MAP_SHARED_VALIDATE != 3 > #error Unexpected value for MAP_SHARED_VALIDATE > #endif > #else /* !MAP_SHARED_VALIDATE */ > #define MAP_SHARED_VALIDATE 3 > #endif > > But I doubt that this is required for this constant. Thanks for the update, Florian. I agree that the above tweak is unnecessary at present -- given that the current code is targeted at Linux on x86_64 and AArch64 where a change is extremely unlikely. That decision may need revisiting if/when the implementation is extended to other ports.
regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander