Re: [RFC v2 01/12] powerpc: Free up four 64K PTE bits in 4K backed hpte pages.

2017-06-22 Thread Ram Pai
On Thu, Jun 22, 2017 at 02:37:27PM +0530, Anshuman Khandual wrote: > On 06/17/2017 09:22 AM, Ram Pai wrote: > > Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6 > > in the 4K backed hpte pages. These bits continue to be used > > for 64K backed hpte pages in this pat

Re: [RFC v3 01/23] powerpc: Free up four 64K PTE bits in 4K backed HPTE pages

2017-06-22 Thread Ram Pai
On Thu, Jun 22, 2017 at 07:21:03PM +1000, Balbir Singh wrote: > On Wed, 2017-06-21 at 18:39 -0700, Ram Pai wrote: > > Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6, > > in the 4K backed HPTE pages. These bits continue to be used > > for 64K backed HPTE pages in thi

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-22 Thread Ram Pai
On Sat, Jun 17, 2017 at 08:54:44AM +1000, Benjamin Herrenschmidt wrote: > On Fri, 2017-06-16 at 12:15 -0700, Ram Pai wrote: > > gp_regs size is not changed, nor is the layout. A unused field in > > the gp_regs is used to fill in the AMR contents. Old binaries will not > >

[RFC PATCH 1/7 v1]powerpc: Free up four PTE bits to accommodate memory keys

2017-06-05 Thread Ram Pai
significantly and has the added advantage of releasing four valuable PTE bits for other purpose. This idea was jointly developed by Paul Mackerras, Aneesh, Michael Ellermen and myself. 4K PTE format remain unchanged currently. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64

[RFC PATCH 0/7 v1] powerpc: Memory Protection Keys

2017-06-05 Thread Ram Pai
the patch separately, along with documentation updates. Thanks-to: Dave Hansen, Aneesh, Paul Mackerras, Michael Ellermen :) Ram Pai (7): Free up four PTE bits to accommadate memory keys Implement sys_pkey_alloc and sys_pkey_free system call. store and restore the key state

[RFC PATCH 6/7 v1]powerpc: Handle exceptions caused by violation of key protection.

2017-06-05 Thread Ram Pai
Handle Data and Instruction exceptions caused by memory protection-key. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu_context.h | 12 + arch/powerpc/include/asm/pkeys.h | 9 arch/powerpc/include/asm/reg.h | 10 +++- arch/powerpc/kernel/exceptions-64s.S | 2

[RFC PATCH 4/7 v1]powerpc: Implementation for sys_mprotect_pkey() system call.

2017-06-05 Thread Ram Pai
This system call, associates the pkey with the pte of all pages corresponding to the given address range. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/pgtable.h | 22 ++- arch/powerpc/include/asm/mman.h | 29 + arch/powerpc/include/asm/pkeys.h

[RFC PATCH 3/7 v1]powerpc: store and restore the key state across context switches.

2017-06-05 Thread Ram Pai
Signed-off-by: Ram Pai --- arch/powerpc/include/asm/processor.h | 5 + arch/powerpc/kernel/process.c| 18 ++ 2 files changed, 23 insertions(+) diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index a2123f2..1f714df 100644

[RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-05 Thread Ram Pai
of the siginfo structure. Signed-off-by: Ram Pai --- arch/powerpc/include/uapi/asm/ptrace.h | 5 +++- arch/powerpc/kernel/asm-offsets.c | 1 + arch/powerpc/kernel/exceptions-64s.S | 8 ++ arch/powerpc/kernel/signal_32.c| 18 ++--- arch/powerpc/kernel/signal_64.c

[RFC PATCH 5/7 v1]powerpc: Program HPTE key protection bits.

2017-06-05 Thread Ram Pai
Map the PTE protection key bits to the HPTE key protection bits, while creatiing HPTE entries. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 5 + arch/powerpc/include/asm/pkeys.h | 7 +++ arch/powerpc/mm/hash_utils_64.c | 5

[RFC PATCH 2/7 v1]powerpc: Implement sys_pkey_alloc and sys_pkey_free system call.

2017-06-05 Thread Ram Pai
Sys_pkey_alloc() allocates and returns available pkey Sys_pkey_free() frees up the key. Total 32 keys are supported on powerpc. However key 0,1 and 31 are reserved. So effectively we have 29 keys. Signed-off-by: Ram Pai --- arch/powerpc/Kconfig | 15 arch/powerpc

Re: [RFC PATCH 1/7 v1]powerpc: Free up four PTE bits to accommodate memory keys

2017-06-12 Thread Ram Pai
On Mon, Jun 12, 2017 at 12:27:44PM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > Rearrange PTE bits to free up bits 3, 4, 5 and 6 for > > memory keys. Bit 3, 4, 5, 6 and 57 shall be used for memory > > keys. > > > > The patch does the fo

Re: [RFC PATCH 1/7 v1]powerpc: Free up four PTE bits to accommodate memory keys

2017-06-13 Thread Ram Pai
On Tue, Jun 13, 2017 at 07:32:24AM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > On Mon, Jun 12, 2017 at 12:27:44PM +0530, Aneesh Kumar K.V wrote: > >> Ram Pai writes: > >> > >> > Rearrange PTE bits to free up bits 3, 4, 5 and 6 for

Re: [RFC PATCH 1/7 v1]powerpc: Free up four PTE bits to accommodate memory keys

2017-06-13 Thread Ram Pai
On Tue, Jun 13, 2017 at 10:22:43AM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > Rearrange PTE bits to free up bits 3, 4, 5 and 6 for > > memory keys. Bit 3, 4, 5, 6 and 57 shall be used for memory > > keys. > > > > The patch does the fo

Re: Read-only `slaves` with shared subtrees?

2017-09-20 Thread Ram Pai
On Tue, Sep 19, 2017 at 04:18:02PM -0700, Dawid Ciezarkiewicz wrote: > On Mon, Sep 18, 2017 at 1:47 PM, Ram Pai wrote: > > It is possible to make a slave mount readonly, by remounting it with > > 'ro' flags. > > > > something like > > > > mount

Re: Read-only `slaves` with shared subtrees?

2017-09-20 Thread Ram Pai
sorry forgot to copy Eric. On Wed, Sep 20, 2017 at 12:39:54PM -0700, Ram Pai wrote: > On Tue, Sep 19, 2017 at 04:18:02PM -0700, Dawid Ciezarkiewicz wrote: > > On Mon, Sep 18, 2017 at 1:47 PM, Ram Pai wrote: > > > It is possible to make a slave mount readonly, by remounting

Re: Read-only `slaves` with shared subtrees?

2017-09-20 Thread Ram Pai
On Wed, Sep 20, 2017 at 06:06:55PM -0500, Eric W. Biederman wrote: > ebied...@xmission.com (Eric W. Biederman) writes: > > > Ram Pai writes: > > > >> sorry forgot to copy Eric. > > > > Adding fs-devel as well. > > > >> On Wed, Sep 20, 2017 at

Re: Read-only `slaves` with shared subtrees?

2017-09-21 Thread Ram Pai
On Wed, Sep 20, 2017 at 08:00:57PM -0700, Dawid Ciezarkiewicz wrote: > On Wed, Sep 20, 2017 at 5:39 PM, Ram Pai wrote: > > Anyway; so something like this should be possible without breaking > > existing semantics. > > > > mount -o bind,remount,ro /mnt > >

Re: [PATCH 4/6] mm/mprotect, powerpc/mm/pkeys, x86/mm/pkeys: Add sysfs interface

2017-09-22 Thread Ram Pai
On Fri, Sep 22, 2017 at 04:00:19PM +1000, Balbir Singh wrote: > On Fri, 15 Sep 2017 18:21:08 -0700 > Ram Pai wrote: > > > From: Thiago Jung Bauermann > > > > Expose useful information for programs using memory protection keys. > > Provide implementation f

Re: Read-only `slaves` with shared subtrees?

2017-10-08 Thread Ram Pai
On Fri, Sep 29, 2017 at 04:02:42PM -0700, Dawid Ciezarkiewicz wrote: > On Fri, Sep 22, 2017 at 11:43 AM, Dawid Ciezarkiewicz > wrote: > > On Thu, Sep 21, 2017 at 12:14 PM, Ram Pai wrote: > >> Here is a patch that accomplishes the job. tested to work with > >> so

Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys

2017-07-29 Thread Ram Pai
> But hopefully the comments that I currently have will be helpful anyway. sure. thanx for taking the time to look through the patches. > > Ram Pai writes: > > diff --git a/arch/powerpc/include/asm/pkeys.h > > b/arch/powerpc/include/asm/pkeys.h > > index 203d7de..09b268e 1

Re: [RFC v6 17/62] powerpc: implementation for arch_set_user_pkey_access()

2017-07-29 Thread Ram Pai
On Thu, Jul 27, 2017 at 11:15:36AM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > @@ -113,10 +117,14 @@ static inline int arch_override_mprotect_pkey(struct > > vm_area_struct *vma, > > return 0; > > } > > > > +extern int __arch_se

Re: [RFC v6 19/62] powerpc: ability to create execute-disabled pkeys

2017-07-29 Thread Ram Pai
On Thu, Jul 27, 2017 at 11:54:31AM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > > --- a/arch/powerpc/include/asm/pkeys.h > > +++ b/arch/powerpc/include/asm/pkeys.h > > @@ -2,6 +2,18 @@ > > #define _ASM_PPC64_PKEYS_H > > > > extern b

Re: [RFC v6 20/62] powerpc: store and restore the pkey state across context switches

2017-07-29 Thread Ram Pai
On Thu, Jul 27, 2017 at 02:32:59PM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > > Store and restore the AMR, IAMR and UMOR register state of the task > > before scheduling out and after scheduling in, respectively. > > > > Signed-off-by: Ram Pa

Re: [RFC v6 15/62] powerpc: helper functions to initialize AMR, IAMR and UMOR registers

2017-07-29 Thread Ram Pai
On Thu, Jul 27, 2017 at 05:40:44PM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > > Introduce helper functions that can initialize the bits in the AMR, > > IAMR and UMOR register; the bits that correspond to the given pkey. > > > > Signed-off-by:

Re: [RFC v6 27/62] powerpc: helper to validate key-access permissions of a pte

2017-07-29 Thread Ram Pai
On Fri, Jul 28, 2017 at 06:00:02PM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > --- a/arch/powerpc/mm/pkeys.c > > +++ b/arch/powerpc/mm/pkeys.c > > @@ -201,3 +201,36 @@ int __arch_override_mprotect_pkey(struct > > vm_area_struct *vma, int prot, >

Re: [RFC v6 21/62] powerpc: introduce execute-only pkey

2017-07-29 Thread Ram Pai
On Fri, Jul 28, 2017 at 07:17:13PM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > --- a/arch/powerpc/mm/pkeys.c > > +++ b/arch/powerpc/mm/pkeys.c > > @@ -97,3 +97,60 @@ int __arch_set_user_pkey_access(struct task_struct *tsk, > > int pkey, > &g

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Ram Pai
On Fri, Jun 16, 2017 at 02:50:13PM +0530, Anshuman Khandual wrote: > On 06/06/2017 06:35 AM, Ram Pai wrote: > > The value of the AMR register at the time of the exception > > is made available in gp_regs[PT_AMR] of the siginfo. > > But its already available there in uctxt-&

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Ram Pai
On Fri, Jun 16, 2017 at 08:33:01PM +1000, Benjamin Herrenschmidt wrote: > On Fri, 2017-06-16 at 14:50 +0530, Anshuman Khandual wrote: > > On 06/06/2017 06:35 AM, Ram Pai wrote: > > > The value of the AMR register at the time of the exception > > > is made availabl

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Ram Pai
On Fri, Jun 16, 2017 at 09:18:29PM +1000, Michael Ellerman wrote: > Ram Pai writes: > > diff --git a/arch/powerpc/include/uapi/asm/ptrace.h > > b/arch/powerpc/include/uapi/asm/ptrace.h > > index 8036b38..109d0c2 100644 > > --- a/arch/powerpc/include/uapi/asm/ptra

[RFC v2 00/12] powerpc: Memory Protection Keys

2017-06-16 Thread Ram Pai
ed by Ben. version v1: Initial version Thanks-to: Dave Hansen, Aneesh, Paul Mackerras, Michael Ellermen Ram Pai (12): Free up four 64K PTE bits in 4K backed hpte pages. Free up four 64K PTE bits in 64K backed hpte pages. Implement sys_pkey_alloc and sys_pkey_free system call.

[RFC v2 05/12] powerpc: Implementation for sys_mprotect_pkey() system call.

2017-06-16 Thread Ram Pai
This system call, associates the pkey with PTE of all pages corresponding to the given address range. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/pgtable.h | 22 ++- arch/powerpc/include/asm/mman.h | 29 + arch/powerpc/include/asm/pkeys.h

[RFC v2 10/12] powerpc: Read AMR only if pkey-violation caused the exception.

2017-06-16 Thread Ram Pai
Signed-off-by: Ram Pai --- arch/powerpc/kernel/exceptions-64s.S | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 8db9ef8..a4de1b4 100644 --- a/arch/powerpc/kernel/exceptions

[RFC v2 01/12] powerpc: Free up four 64K PTE bits in 4K backed hpte pages.

2017-06-16 Thread Ram Pai
advantage of releasing four valuable PTE bits for other purpose. This idea was jointly developed by Paul Mackerras, Aneesh, Michael Ellermen and myself. 4K PTE format remain unchanged currently. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/hash-4k.h | 20 +++ arch/powerpc

[RFC v2 11/12]Documentation: Documentation updates.

2017-06-16 Thread Ram Pai
The Documentaton file is moved from x86 into the generic area, since this feature is now supported by more than one archs. Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 110 ++ Documentation/x86/protection-keys.txt | 85

[RFC v2 08/12] powerpc: Handle exceptions caused by violation of pkey protection.

2017-06-16 Thread Ram Pai
Handle Data and Instruction exceptions caused by memory protection-key. Signed-off-by: Ram Pai (cherry picked from commit a5e5217619a0c475fe0cacc3b0cf1d3d33c79a09) Conflicts: arch/powerpc/include/asm/reg.h arch/powerpc/kernel/exceptions-64s.S --- arch/powerpc/include/asm

[RFC v2 12/12]selftest: Updated protection key selftest

2017-06-16 Thread Ram Pai
Added test support for PowerPC implementation off protection keys. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/Makefile |1 + tools/testing/selftests/vm/pkey-helpers.h | 365 +++ tools/testing/selftests/vm/protection_keys.c | 1451

[RFC v2 07/12] powerpc: Macro the mask used for checking DSI exception

2017-06-16 Thread Ram Pai
Replace the magic number used to check for DSI exception with a meaningful value. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/reg.h | 9 - arch/powerpc/kernel/exceptions-64s.S | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm

[RFC v2 09/12] powerpc: Deliver SEGV signal on pkey violation.

2017-06-16 Thread Ram Pai
structure. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/paca.h| 1 + arch/powerpc/include/uapi/asm/ptrace.h | 3 ++- arch/powerpc/kernel/asm-offsets.c | 5 arch/powerpc/kernel/exceptions-64s.S | 8 ++ arch/powerpc/kernel/signal_32.c| 14 ++ arch

[RFC v2 04/12] powerpc: store and restore the pkey state across context switches.

2017-06-16 Thread Ram Pai
Signed-off-by: Ram Pai --- arch/powerpc/include/asm/processor.h | 5 + arch/powerpc/kernel/process.c| 18 ++ 2 files changed, 23 insertions(+) diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index a2123f2..1f714df 100644

[RFC v2 06/12] powerpc: Program HPTE key protection bits.

2017-06-16 Thread Ram Pai
Map the PTE protection key bits to the HPTE key protection bits, while creatiing HPTE entries. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 5 + arch/powerpc/include/asm/pkeys.h | 7 +++ arch/powerpc/mm/hash_utils_64.c | 5

[RFC v2 02/12] powerpc: Free up four 64K PTE bits in 64K backed hpte pages.

2017-06-16 Thread Ram Pai
part of the PTE will hold (H_PAGE_F_SECOND|H_PAGE_F_GIX) at bit 60,61,62,63. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/hash-64k.h | 26 -- arch/powerpc/mm/hash64_64k.c | 16 +++- arch/powerpc/mm/hugetlbpage-hash64.c

[RFC v2 03/12] powerpc: Implement sys_pkey_alloc and sys_pkey_free system call.

2017-06-16 Thread Ram Pai
Sys_pkey_alloc() allocates and returns available pkey Sys_pkey_free() frees up the pkey. Total 32 keys are supported on powerpc. However pkey 0,1 and 31 are reserved. So effectively we have 29 pkeys. Signed-off-by: Ram Pai --- arch/powerpc/Kconfig | 15 arch

Re: [RFC v2 10/12] powerpc: Read AMR only if pkey-violation caused the exception.

2017-06-19 Thread Ram Pai
On Mon, Jun 19, 2017 at 09:06:13PM +1000, Michael Ellerman wrote: > Ram Pai writes: > > > Signed-off-by: Ram Pai > > --- > > arch/powerpc/kernel/exceptions-64s.S | 16 ++-- > > 1 file changed, 10 insertions(+), 6 deletions(-) > > > > d

Re: [PATCH v9 00/51] powerpc, mm: Memory Protection Keys

2017-11-09 Thread Ram Pai
On Mon, Nov 06, 2017 at 05:22:18PM -0800, Ram Pai wrote: > On Mon, Nov 06, 2017 at 10:28:41PM +0100, Florian Weimer wrote: > > * Ram Pai: > > > > > Testing: > > > --- > > > This patch series has passed all the protection key > > > tests avai

Re: [PATCH v9 44/51] selftest/vm: powerpc implementation for generic abstraction

2017-11-09 Thread Ram Pai
On Thu, Nov 09, 2017 at 04:47:15PM -0200, Breno Leitao wrote: > Hi Ram, > > On Mon, Nov 06, 2017 at 12:57:36AM -0800, Ram Pai wrote: > > @@ -206,12 +209,14 @@ void signal_handler(int signum, siginfo_t *si, void > > *vucontext) > > > > trapno = uc

Re: Improving documentation of parent-ID field in /proc/PID/mountinfo

2017-11-20 Thread Ram Pai
> Hi Miklos, Ram > >> > >> Thanks for your comments. A question below. > >> > >> On 13 November 2017 at 09:11, Miklos Szeredi wrote: > >>> On Mon, Nov 13, 2017 at 8:55 AM, Ram Pai wrote: > >>>> On Mon, Nov 13, 2017 at 07:02:21AM +0

Re: [PATCH v9 00/51] powerpc, mm: Memory Protection Keys

2017-11-06 Thread Ram Pai
On Mon, Nov 06, 2017 at 10:28:41PM +0100, Florian Weimer wrote: > * Ram Pai: > > > Testing: > > --- > > This patch series has passed all the protection key > > tests available in the selftest directory.The > > tests are updated to work on both x86 and power

Re: [PATCH v9 00/51] powerpc, mm: Memory Protection Keys

2017-11-07 Thread Ram Pai
On Tue, Nov 07, 2017 at 08:32:16AM +0100, Florian Weimer wrote: > * Ram Pai: > > > On Mon, Nov 06, 2017 at 10:28:41PM +0100, Florian Weimer wrote: > >> * Ram Pai: > >> > >> > Testing: > >> > --- > >> > This patch series has pa

Re: [PATCH v9 00/51] powerpc, mm: Memory Protection Keys

2017-11-07 Thread Ram Pai
On Tue, Nov 07, 2017 at 02:47:10PM -0800, Dave Hansen wrote: > On 11/07/2017 02:39 PM, Ram Pai wrote: > > > > As per the current semantics of sys_pkey_free(); the way I understand it, > > the calling thread is saying disassociate me from this key. > > No. It is saying

[RFC PATCH 02/16] DM: Ability to choose the compressor.

2016-08-15 Thread Ram Pai
Ability to create a block device with a compression algorithm of the users choice. Currently lzo and nx842 compressors are supported. If the compressor algorithm is not specified the default setting in /sys/modules/dm-inplace-compress/parameters/compress is used. Signed-off-by: Ram Pai

[RFC PATCH 00/16] dm-inplace-compression block device

2016-08-15 Thread Ram Pai
device. Your comments to improve the code is very much appreciated. Ram Pai (15): DM: Ability to choose the compressor. DM: Error if enough space is not available. DM: Ensure that the read request is within the device range. DM: allocation/free helper routines. DM: separate out compression

[RFC PATCH 06/16] DM: separate out compression and decompression routines.

2016-08-15 Thread Ram Pai
Simplify the code by separating out the compression and decompression routines. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c | 127 +- 1 files changed, 71 insertions(+), 56 deletions(-) diff --git a/drivers/md/dm-inplace-compress.c b/drivers

[RFC PATCH 12/16] DM: release unneeded buffer as soon as possible.

2016-08-15 Thread Ram Pai
Done to conserve as much free space as possible. Waiting to release till the bio is done will unneccesarily hog up memory. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c | 14 +++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-inplace

[RFC PATCH 16/16] DM: add documentation for dm-inplace-compress.

2016-08-15 Thread Ram Pai
Signed-off-by: Ram Pai --- .../device-mapper/dm-inplace-compress.text | 138 1 files changed, 138 insertions(+), 0 deletions(-) create mode 100644 Documentation/device-mapper/dm-inplace-compress.text diff --git a/Documentation/device-mapper/dm-inplace

[RFC PATCH 11/16] DM: Try to avoid temporary buffer allocation to hold compressed data.

2016-08-15 Thread Ram Pai
y buffer across read boundaries. Which is a huge advantage especially if we are operating under acute memory starvation; mostly when this block device is used as a swap device. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c | 185 ++--- drivers/md/dm-inp

[RFC PATCH 15/16] DM: Add sysfs parameters to track total memory saved and allocated.

2016-08-15 Thread Ram Pai
Add parameters to monitor the memory efficiency of the module. dm_icomp_total_alloc_size: total memory currently in use. dm_icomp_total_bio_save: total memory allocation saved by the optimizations. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c | 36

[RFC PATCH 13/16] DM: macros to set and get the state of the request.

2016-08-15 Thread Ram Pai
Consolidate code to set and get the state of a request. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c | 31 +-- 1 files changed, 17 insertions(+), 14 deletions(-) diff --git a/drivers/md/dm-inplace-compress.c b/drivers/md/dm-inplace-compress.c index

[RFC PATCH 09/16] DM: Delay allocation of decompression buffer during read.

2016-08-15 Thread Ram Pai
. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c | 76 +- drivers/md/dm-inplace-compress.h |3 +- 2 files changed, 68 insertions(+), 11 deletions(-) diff --git a/drivers/md/dm-inplace-compress.c b/drivers/md/dm-inplace-compress.c index 04decdd

[RFC PATCH 14/16] DM: Wasted bio copy.

2016-08-15 Thread Ram Pai
No point doing it. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/md/dm-inplace-compress.c b/drivers/md/dm-inplace-compress.c index 55a515b..31b144b 100644 --- a/drivers/md/dm-inplace-compress.c +++ b

[RFC PATCH 05/16] DM: allocation/free helper routines.

2016-08-15 Thread Ram Pai
Helper functions to allocate/reallocate and free memory. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/drivers/md/dm-inplace-compress.c b/drivers/md/dm-inplace-compress.c index bf18028

[RFC PATCH 01/16] DM: dm-inplace-compress: an inplace compressed DM target

2016-08-15 Thread Ram Pai
still function well. Signed-off-by: Shaohua Li Signed-off-by: Ram Pai --- drivers/md/Kconfig |6 + drivers/md/Makefile |1 + drivers/md/dm-inplace-compress.c | 1487 ++ drivers/md/dm-inplace-compress.h | 140 4 files c

[RFC PATCH 07/16] DM: Optimize memory allocated to hold compressed buffer.

2016-08-15 Thread Ram Pai
On an average the compressed size is less than 50% of the original buffer. Use this knowledge to optimize the amount of space allocated to hold the compressed buffer. If the allocated size is determined to be insufficient than reallocate the required size. Signed-off-by: Ram Pai --- drivers/md

[RFC PATCH 10/16] DM: Try to use the bio buffer for decompression instead of allocating one.

2016-08-15 Thread Ram Pai
in the bio-buffer is contigious within the same bio-segment. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c | 143 ++--- drivers/md/dm-inplace-compress.h |2 + 2 files changed, 102 insertions(+), 43 deletions(-) diff --git a/drivers/md/dm-inplace-co

[RFC PATCH 03/16] DM: Error if enough space is not available.

2016-08-15 Thread Ram Pai
if enough space is not available to create a block of the specified size error out. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/md/dm-inplace-compress.c b/drivers/md/dm-inplace-compress.c index

[RFC PATCH 04/16] DM: Ensure that the read request is within the device range.

2016-08-15 Thread Ram Pai
If a read request is not within the device range return error. Signed-off-by: Ram Pai --- drivers/md/dm-inplace-compress.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/drivers/md/dm-inplace-compress.c b/drivers/md/dm-inplace-compress.c index 17221a1..bf18028

[RFC PATCH 08/16] DM: Tag a magicmarker at the end of each compressed segment.

2016-08-15 Thread Ram Pai
We store the size of the compressed segment, on the sector boundary. And later use that location to determine the size of the compressed segment. However if that location is corrupted for any reason we would'nt know. Hence add a magicmarker to catch for such corruptions. Signed-off-by: Ra

<    1   2   3   4   5   6