Todd Lipcon has uploaded this change for review. ( http://gerrit.cloudera.org:8080/9848
Change subject: KUDU-2378. Fix unaligned loads of int128 from rows ...................................................................... KUDU-2378. Fix unaligned loads of int128 from rows Our row format doesn't ensure any alignment of data. This is usually fine on x86 where unaligned loads of ints don't need any special instruction and carry a relatively low performance penalty. However, loads of int128_t may generate a 'movdqa' (aligned load) instruction which crashes if the operand is not 16-byte aligned. This fixes a bunch of spots where we are dereferencing a reinterpret_casted int and replaces them with a new UnalignedLoad<> templated function. This function delegates to the UNALIGNED_LOAD macros for <=64bit types, which themselves are equivalent to *reinterpret_cast<T*> on x86. For int128_t, and for floats/doubles, we delegate to memcpy. The compiler should already treat memcpy as an intrinsic and this will end up being a single instruction[1] [1] https://godbolt.org/g/iT8coU Change-Id: Ic71149ed5c6881cb16dfe6cf8f7906c044a0b41a --- M src/kudu/cfile/binary_dict_block.cc M src/kudu/cfile/bshuf_block.cc M src/kudu/cfile/bshuf_block.h M src/kudu/cfile/cfile-test.cc M src/kudu/cfile/plain_block.h M src/kudu/cfile/rle_block.h M src/kudu/client/client-test.cc M src/kudu/common/partial_row.cc M src/kudu/common/row.h M src/kudu/common/types.h M src/kudu/common/wire_protocol-test.cc M src/kudu/fs/log_block_manager-test.cc M src/kudu/gutil/port.h M src/kudu/integration-tests/all_types-itest.cc M src/kudu/tablet/cfile_set-test.cc M src/kudu/tablet/concurrent_btree.h M src/kudu/tablet/mt-tablet-test.cc M src/kudu/tablet/tablet-test-base.h M src/kudu/util/group_varint-inl.h M src/kudu/util/group_varint-test.cc M src/kudu/util/inline_slice.h 21 files changed, 177 insertions(+), 110 deletions(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/48/9848/1 -- To view, visit http://gerrit.cloudera.org:8080/9848 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic71149ed5c6881cb16dfe6cf8f7906c044a0b41a Gerrit-Change-Number: 9848 Gerrit-PatchSet: 1 Gerrit-Owner: Todd Lipcon <[email protected]>
