linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch 0/4] RFC : Support for data gradation of a single file.
@ 2018-04-06 11:41 Sayan Ghosh
  2018-04-06 21:31 ` Andreas Dilger
  2018-04-06 22:27 ` Theodore Y. Ts'o
  0 siblings, 2 replies; 10+ messages in thread
From: Sayan Ghosh @ 2018-04-06 11:41 UTC (permalink / raw)
  To: linux-ext4
  Cc: linux-fsdevel, Bhattacharya, Suparna, niloy ganguly,
	Madhumita Mallick, Bharde, Madhumita

Hi all,

The following series of patches aim to store a file with a graded
information. Consider a scenario of video indexing for learning
programme where some of the portions of the video is annotated and
important than other portions, hence to be accessed more often. We
consider the similar scenario where we have a file along with a grade
information that mentions which blocks are important and which are
not. The grades we consider are binary with 1 denoting high grade.
Now the file is stored in a LVM which comprises of different set of
storage devices belong to different tiers (as ext4 doesn’t support
spanning over multiple block driver), - one combination could be
persistent memory and hard-disk. The target is to store the higher
graded blocks in the higher performance tier and the lower graded
blocks in the lower performance tier.
Consider a C code where the grade of the file blocks are being set in
the user space through extended attribute. The grade structure stores
the span of different high graded segments in the file with starting
high grade block numbers and the span length of the segments. We
assume grade of rest of the blocks as 0 (low).

---
typedef struct _grade{
   unsigned long long block_num;
   unsigned long long length;
} grade_extents;

int fd = open(filename, O_CREAT|O_RDWR, (mode_t)00777);
int xattr_value = 1;
int status1 = fsetxattr(fd, "user.is_graded", (const void *)&xattr_value,
                    sizeof(int), 0 );

grade_extents grade_array[] = {{1,2},{50,10}};
int status2 = fsetxattr(fd, "user.grade_array", (const void *)grade_array,
                        count*sizeof(grade_struct), 0 );

/* creating a 1 MB file */
int status3 = fallocate(fd, 0, 0, (1024 * 1024));
----

The first 2 patches of the series aim to read the grades and
pre-allocate space through fallocate in the respective tiers.
The next task is to write and read data to and from these files
(respectively). The 3rd patch aims at solving this issue.
The final patch in this patch series helps to get a reduced view of
the file, ie. just shows the high graded blocks of the file - the
motivation being  an application may need to access only the important
portions of the file such as accessing only the annotated parts of a
learning video.
We made the patches on top of Linux Kernel 4.7.2.

---
 fs/dax.c          | 139 +++++++++++++++++++++++++++++++++
 fs/ext4/ext4.h    |  17 +++++
 fs/ext4/extents.c | 151 +++++++++++++++++++++++++++++++++++-
 fs/ext4/file.c    | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 525 insertions(+), 7 deletions(-)

Regards,
Sayan Ghosh
IIT Kharagpur
‌

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-11  9:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-06 11:41 [Patch 0/4] RFC : Support for data gradation of a single file Sayan Ghosh
2018-04-06 21:31 ` Andreas Dilger
2018-04-06 22:27 ` Theodore Y. Ts'o
2018-04-09  4:03   ` Andreas Dilger
2018-04-10  9:46     ` Sayan Ghosh
2018-04-10 18:40       ` Andreas Dilger
2018-04-11  9:20         ` Bhattacharya, Suparna
2018-04-10  9:56     ` Sayan Ghosh
2018-04-10 23:39       ` Dave Chinner
2018-04-10  9:52   ` Sayan Ghosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).