Displaying 4 results from an estimated 4 matches for "do_fadvise".
Did you mean:
dc_madvise
2012 Feb 18
4
FADV_DONTNEED support
While going through an old todo list I found that these patches had fallen by
the way-side. About a year ago I initiated a discussion[1] with the Linux
kernel folks regarding the lack of any useable fadvise support on the kernel
side. As a result, I was observing extremely poor performance on my server
after backup as executable pages were being swapped out in favor of data
waiting to be flushed
2010 Nov 23
0
[PATCH 1/3] Add fadvise interface wrapper
...-28,6 +28,7 @@
#ifdef HAVE_SYS_ATTR_H
#include <sys/attr.h>
#endif
+#include <fcntl.h>
extern int dry_run;
extern int am_root;
@@ -282,3 +283,13 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
return lseek(fd, offset, whence);
#endif
}
+
+#if _XOPEN_SOURCE >= 600
+int do_fadvise(int fd, OFF_T offset, OFF_T len, int advise)
+{
+ return posix_fadvise(fd, offset, len, advise);
+}
+#else
+#define do_fadvise()
+#endif
+
--
1.7.1
2010 Nov 23
0
[PATCH 2/3] Inform kernel of FADV_DONTNEED hint in sender
...sender.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/sender.c b/sender.c
index 59dae7d..a934bfe 100644
--- a/sender.c
+++ b/sender.c
@@ -338,6 +338,12 @@ void send_files(int f_in, int f_out)
if (do_progress)
end_progress(st.st_size);
+ if (do_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED) != 0) {
+ rsyserr(FERROR_XFER, errno,
+ "fadvise failed in sending %s",
+ full_fname(fname));
+ }
+
log_item(log_code, file, &initial_stats, iflags, NU...
2010 Nov 23
0
[PATCH 3/3] Inform kernel of FADV_DONTNEED hint in receiver
...letions(-)
diff --git a/receiver.c b/receiver.c
index 39c5e49..33b21fb 100644
--- a/receiver.c
+++ b/receiver.c
@@ -721,6 +721,12 @@ int recv_files(int f_in, char *local_name)
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
fname, fd2, F_LENGTH(file));
+ if (do_fadvise(fd2, 0, 0, POSIX_FADV_DONTNEED) != 0) {
+ rsyserr(FERROR_XFER, errno,
+ "fadvise failed in writing %s",
+ full_fname(fname));
+ }
+
log_item(log_code, file, &initial_stats, iflags, N...