Re: [RFC PATCH 00/11] Adding FreeBSD's Capsicum security framework (part 1)

2014-07-07 Thread David Drysdale
On Fri, Jul 4, 2014 at 8:03 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 03/07/2014 20:39, David Drysdale ha scritto: On Thu, Jul 03, 2014 at 11:12:33AM +0200, Paolo Bonzini wrote: Given Linux's previous experience with BPF filters, what do you think about attaching specific BPF programs

Re: [PATCH v10 1/7] mm: support madvise(MADV_FREE)

2014-07-07 Thread Kirill A. Shutemov
On Mon, Jul 07, 2014 at 09:53:52AM +0900, Minchan Kim wrote: Linux doesn't have an ability to free pages lazy while other OS already have been supported that named by madvise(MADV_FREE). The gain is clear that kernel can discard freed pages rather than swapping out or OOM if memory pressure

Re: [PATCH v10 2/7] x86: add pmd_[dirty|mkclean] for THP

2014-07-07 Thread Kirill A. Shutemov
On Mon, Jul 07, 2014 at 09:53:53AM +0900, Minchan Kim wrote: MADV_FREE needs pmd_dirty and pmd_mkclean for detecting recent overwrite of the contents since MADV_FREE syscall is called for THP page. This patch adds pmd_dirty and pmd_mkclean for THP page MADV_FREE support. Cc: Thomas

Re: [PATCH v10 7/7] mm: Don't split THP page when syscall is called

2014-07-07 Thread Kirill A. Shutemov
On Mon, Jul 07, 2014 at 09:53:58AM +0900, Minchan Kim wrote: We don't need to split THP page when MADV_FREE syscall is called. It could be done when VM decide really frees it so we could reduce the number of THP split. Signed-off-by: Minchan Kim minc...@kernel.org ---

Re: [RFC PATCH 00/11] Adding FreeBSD's Capsicum security framework (part 1)

2014-07-07 Thread Paolo Bonzini
Il 07/07/2014 12:29, David Drysdale ha scritto: I think that's more easily done by opening the file as O_RDONLY/O_WRONLY /O_RDWR. You could do it by running the file descriptor's seccomp-bpf program once per iocb with synthesized syscall numbers and argument vectors. Right, but generating

Re: [RFC PATCH 00/11] Adding FreeBSD's Capsicum security framework (part 1)

2014-07-07 Thread David Drysdale
On Mon, Jul 7, 2014 at 1:20 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 07/07/2014 12:29, David Drysdale ha scritto: Capsicum capabilities are associated with the file descriptor (a la F_GETFD), not the open file itself -- different FDs with different associated rights can map to the same

[PATCH v3 2/3] selftests/fincore: add test code for fincore()

2014-07-07 Thread Naoya Horiguchi
This patch adds simple test programs for fincore(), which contains the following testcase: - test_smallfile_bytemap - test_smallfile_pfn - test_smallfile_multientry - test_smallfile_pfn_skiphole - test_largefile_pfn - test_largefile_pfn_offset - test_largefile_pfn_overrun -

[PATCH v3 1/3] mm: introduce fincore()

2014-07-07 Thread Naoya Horiguchi
This patch provides a new system call fincore(), which extracts mincore()- like information from the kernel, i.e. page residency of a given file. But unlike mincore(), fincore() has a mode flag which allows us to extract more detailed information like pfn and page flag. This kind of information is

[no subject]

2014-07-07 Thread L polyzoi
Give your loved ones a branded watch today http://media.skarea2.go.th/components/com_swmenufree/preg_class.php -- To unsubscribe from this list: send the line unsubscribe linux-api in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH v3 1/3] mm: introduce fincore()

2014-07-07 Thread Dave Hansen
+/* + * You can control how the buffer in userspace is filled with this mode + * parameters: I agree that we don't have any good mechanisms for looking at the page cache from userspace. I've hacked some things up using mincore() and they weren't pretty, so I welcome _something_ like this.

Re: [PATCH v3 3/3] man2/fincore.2: document general description about fincore(2)

2014-07-07 Thread Dave Hansen
On 07/07/2014 11:00 AM, Naoya Horiguchi wrote: +.SH RETURN VALUE +On success, +.BR fincore () +returns 0. +On error, \-1 is returned, and +.I errno +is set appropriately. Is this accurate? From reading the syscall itself, it looked like it did this: + * Return value is the number of

Re: [PATCH v3 1/3] mm: introduce fincore()

2014-07-07 Thread Naoya Horiguchi
Hi Dave, Thank you for the comments. On Mon, Jul 07, 2014 at 12:01:41PM -0700, Dave Hansen wrote: +/* + * You can control how the buffer in userspace is filled with this mode + * parameters: I agree that we don't have any good mechanisms for looking at the page cache from userspace.

Re: [PATCH v3 1/3] mm: introduce fincore()

2014-07-07 Thread Dave Hansen
On 07/07/2014 01:21 PM, Naoya Horiguchi wrote: On Mon, Jul 07, 2014 at 12:01:41PM -0700, Dave Hansen wrote: But, is this trying to do too many things at once? Do we have solid use cases spelled out for each of these modes? Have we thought out how they will be used in practice?

Re: [PATCH v3 3/3] man2/fincore.2: document general description about fincore(2)

2014-07-07 Thread Naoya Horiguchi
On Mon, Jul 07, 2014 at 12:08:12PM -0700, Dave Hansen wrote: On 07/07/2014 11:00 AM, Naoya Horiguchi wrote: +.SH RETURN VALUE +On success, +.BR fincore () +returns 0. +On error, \-1 is returned, and +.I errno +is set appropriately. Is this accurate? From reading the syscall

Re: [RFC PATCH 00/11] Adding FreeBSD's Capsicum security framework (part 1)

2014-07-07 Thread Alexei Starovoitov
On Mon, Jul 7, 2014 at 5:20 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 07/07/2014 12:29, David Drysdale ha scritto: I think that's more easily done by opening the file as O_RDONLY/O_WRONLY /O_RDWR. You could do it by running the file descriptor's seccomp-bpf program once per iocb with

Re: [PATCH v3 3/3] man2/fincore.2: document general description about fincore(2)

2014-07-07 Thread Dave Hansen
On 07/07/2014 01:59 PM, Naoya Horiguchi wrote: On Mon, Jul 07, 2014 at 12:08:12PM -0700, Dave Hansen wrote: On 07/07/2014 11:00 AM, Naoya Horiguchi wrote: +.SH RETURN VALUE +On success, +.BR fincore () +returns 0. +On error, \-1 is returned, and +.I errno +is set appropriately. Is this

Re: [PATCH v10 1/7] mm: support madvise(MADV_FREE)

2014-07-07 Thread Minchan Kim
On Mon, Jul 07, 2014 at 01:41:37PM +0300, Kirill A. Shutemov wrote: On Mon, Jul 07, 2014 at 09:53:52AM +0900, Minchan Kim wrote: Linux doesn't have an ability to free pages lazy while other OS already have been supported that named by madvise(MADV_FREE). The gain is clear that kernel can

Re: [PATCH v10 6/7] ARM: add pmd_[dirty|mkclean] for THP

2014-07-07 Thread Minchan Kim
On Mon, Jul 07, 2014 at 10:22:48AM +0100, Steve Capper wrote: On Mon, Jul 07, 2014 at 09:53:57AM +0900, Minchan Kim wrote: MADV_FREE needs pmd_dirty and pmd_mkclean for detecting recent overwrite of the contents since MADV_FREE syscall is called for THP page. This patch adds pmd_dirty

Re: [PATCH v10 1/7] mm: support madvise(MADV_FREE)

2014-07-07 Thread Zhang Yanfei
Hi Minchan, On 07/07/2014 08:53 AM, Minchan Kim wrote: Linux doesn't have an ability to free pages lazy while other OS already have been supported that named by madvise(MADV_FREE). The gain is clear that kernel can discard freed pages rather than swapping out or OOM if memory pressure

Re: [PATCH v10 1/7] mm: support madvise(MADV_FREE)

2014-07-07 Thread Minchan Kim
Hello Zhang, On Tue, Jul 08, 2014 at 11:54:12AM +0800, Zhang Yanfei wrote: Hi Minchan, On 07/07/2014 08:53 AM, Minchan Kim wrote: Linux doesn't have an ability to free pages lazy while other OS already have been supported that named by madvise(MADV_FREE). The gain is clear that