Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Issue 969403003: Ignore NaCl st_blksize of 0 and buffer writes to raw_fd_ostream. (Closed)

Created:
5 years, 9 months ago by jvoung (off chromium)
Modified:
5 years, 9 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Ignore NaCl st_blksize of 0 and buffer writes to raw_fd_ostream. The default LLVM raw_fd_ostream buffer size is based on stat'ing the FD and then checking st_blksize. Unfortunately, in the NaCl sandboxed build of pnacl-sz, NaCl's syscall returns st_blksize of 0 which makes the writes unbuffered. There is a comment in "src/trusted/service_runtime/include/bits/stat.h": nacl_abi_blksize_t nacl_abi_st_blksize; /* not implemented */ And the " src/trusted/desc/" implementation sets this to 0. This results in half a million write syscalls to translate the GCC pexe, which roughly doubles the translation time in sandboxed mode vs unsandboxed mode. Manually set a buffer size (Linux st_blksize seems to be about 4KB for comparison). This drops the number of write syscalls to about 200 for translating the GCC pexe. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091 R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=437ceff23f529d87a6dac702dd4bfbaec021321f

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M src/main.cpp View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
jvoung (off chromium)
5 years, 9 months ago (2015-03-03 17:00:56 UTC) #2
Jim Stichnoth
Cool! lgtm
5 years, 9 months ago (2015-03-03 17:32:54 UTC) #3
jvoung (off chromium)
5 years, 9 months ago (2015-03-03 18:22:22 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
437ceff23f529d87a6dac702dd4bfbaec021321f (tree was closed).

Powered by Google App Engine
This is Rietveld 408576698