From: Boaz Harrosh <openosd@gmail.com>
To: Boaz Harrosh <boaz@plexistor.com>,
Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Matthew Wilcox <willy@linux.intel.com>,
Sagi Manole <sagi@plexistor.com>,
Yigal Korman <yigal@plexistor.com>
Subject: Re: [PATCH 5/9 v2] SQUASHME: prd: Last fixes for partitions
Date: Tue, 26 Aug 2014 20:36:19 +0300 [thread overview]
Message-ID: <53FCC593.6020201@gmail.com> (raw)
In-Reply-To: <53FC42C5.6040300@plexistor.com>
[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]
On 08/26/2014 11:18 AM, Boaz Harrosh wrote:
> On 08/25/2014 11:10 PM, Ross Zwisler wrote:
> <>
>> I think we can still have a working probe by instead comparing the passed in
>> dev_t against the dev_t we get back from disk_to_dev(prd->prd_disk), but I'd
>> really like a use case so I can test this. Until then I think I'm just going
>> to stub out prd/pmem_probe() with a BUG() so we can see if anyone hits it.
>>
>> It seems like this is preferable to just registering NULL for probe, as that
>> would cause an oops in kobj_lookup(() when probe() is blindly called without
>> checking for NULL.
>>
>
> I have a version I think you will love it removes the probe and bunch of
> other stuff.
>
> I tested it heavily it just works
>
> Comming soon, I'm preparing trees right now
> Thanks
> Boaz
Ross hi
It is getting late around here and I will not be pushing new trees
tonight, first thing tomorrow morning. (Your last push caused me lots
of extra work, you must not do like you did when working on a rebasing
out-off-tree project involving more then one person, but more on the proper
procedure tomorrow with the push of the trees)
So I hope you are not doing any big changes, do not apply any of my patches
just yet, wait for the new trees tomorrow please I have everything all ready
on top of the rename to pmem
Meanwhile without any explanations, these will come tomorrow, I'm attaching
the most interesting bit which you have not seen before.
If you want you can inspect a preview of what's to come here:
http://git.open-osd.org/gitweb.cgi?p=pmem.git;a=summary
I have created a new pmem.git tree just for us.
Thanks
Boaz
[-- Attachment #2: 0012-SQUASHME-pmem-KISS-remove-the-all-pmem_major-registr.patch --]
[-- Type: text/x-patch, Size: 4482 bytes --]
>From 748370b1220693b755b6b92828e651cc0bac7846 Mon Sep 17 00:00:00 2001
From: Boaz Harrosh <boaz@plexistor.com>
Date: Thu, 21 Aug 2014 19:03:48 +0300
Subject: [PATCH 12/12] SQUASHME: pmem: KISS, remove the all pmem_major
registration
Though this looks revolutionary, it actually does nothing
but removes dead code.
Since the move of pmem to the dynamic BLOCK_EXT_MAJOR
range, by Ross, all this stuff is not used by the Kernel.
Note that with current code pmem_major defaults to ZERO
but even if I run with
modprobe pmem map=1G@1G pmem_major=17
I still ever get:
brw-rw----. 1 root disk 259, 0 Aug 21 19:02 /dev/pmem0
brw-rw----. 1 root disk 259, 1 Aug 21 19:02 /dev/pmem0p1
brw-rw----. 1 root disk 259, 2 Aug 21 19:02 /dev/pmem0p2
>From the BLOCK_EXT_MAJOR (259) range. Even Though the
registration of pmem_major=17 succeeded just fine, and
disk->major = 17;
was set in pmem_alloc()
I have tested all the tests that I know how to perform
on the devices, fdisk, partitions, multiple pmemX devices,
mknode, lsblk, blkid, and it all behaves exactly as
before this patch.
I have also done:
find /sys/ -name "*pmem*"
find /proc/ -name "*pmem*"
find /dev/ -name "*pmem*"
And get the same output as before this patch.
If anyone knows of what would work differently after this
patch please do tell.
But it looks like the calls to register_blkdev +
blk_register_region are just dead code for us right now
Thanks
Signed-off-by: Boaz Harrosh <boaz@plexistor.com>
---
drivers/block/pmem.c | 45 +--------------------------------------------
1 file changed, 1 insertion(+), 44 deletions(-)
diff --git a/drivers/block/pmem.c b/drivers/block/pmem.c
index a272c43..014bba7 100644
--- a/drivers/block/pmem.c
+++ b/drivers/block/pmem.c
@@ -228,9 +228,6 @@ static const struct block_device_operations pmem_fops = {
};
/* Kernel module stuff */
-static int pmem_major;
-module_param(pmem_major, int, 0);
-MODULE_PARM_DESC(pmem_major, "Major number to request for this driver");
static char *map;
module_param(map, charp, S_IRUGO);
@@ -239,7 +236,6 @@ MODULE_PARM_DESC(map,
"mapS=nn[KMG]$ss[KMG] or mapS=nn[KMG]@ss[KMG], nn=size, ss=offset.");
static LIST_HEAD(pmem_devices);
-static DEFINE_MUTEX(pmem_devices_mutex);
#ifdef CONFIG_BLK_DEV_PMEM_USE_PAGES
static int pmem_add_page_mapping(phys_addr_t phys_addr, size_t total_size,
@@ -455,7 +451,7 @@ static struct pmem_device *pmem_alloc(phys_addr_t phys_addr, size_t disk_size,
err = -ENOMEM;
goto out_free_queue;
}
- disk->major = pmem_major;
+ disk->major = BLOCK_EXT_MAJOR;
disk->first_minor = 0;
disk->fops = &pmem_fops;
disk->private_data = pmem;
@@ -492,30 +488,6 @@ static void pmem_del_one(struct pmem_device *pmem)
pmem_free(pmem);
}
-/*FIXME: Actually in our driver pmem_probe is never used. Can be removed */
-static struct kobject *pmem_probe(dev_t dev, int *part, void *data)
-{
- struct pmem_device *pmem;
- struct kobject *kobj;
- int number = MINOR(dev);
-
- mutex_lock(&pmem_devices_mutex);
-
- list_for_each_entry(pmem, &pmem_devices, pmem_list) {
- if (pmem->pmem_number == number) {
- kobj = get_disk(pmem->pmem_disk);
- goto out;
- }
- }
-
- pr_err("pmem: pmem_probe: Unexpected parameter=%d\n", number);
- kobj = NULL;
-
-out:
- mutex_unlock(&pmem_devices_mutex);
- return kobj;
-}
-
static int pmem_parse_map_one(char *map, phys_addr_t *start, size_t *size)
{
char *p = map;
@@ -540,13 +512,6 @@ static int __init pmem_init(void)
return -EINVAL;
}
- result = register_blkdev(pmem_major, "pmem");
- if (result < 0) {
- result = -EIO;
- goto out;
- } else if (result > 0)
- pmem_major = result;
-
i = 0;
while ((p = strsep(&pmem_map, ",")) != NULL) {
phys_addr_t phys_addr;
@@ -570,9 +535,6 @@ static int __init pmem_init(void)
list_for_each_entry(pmem, &pmem_devices, pmem_list)
add_disk(pmem->pmem_disk);
- blk_register_region(MKDEV(pmem_major, 0), 0,
- THIS_MODULE, pmem_probe, NULL, NULL);
-
pr_info("pmem: module loaded\n");
return 0;
@@ -581,8 +543,6 @@ out_free:
list_del(&pmem->pmem_list);
pmem_free(pmem);
}
- unregister_blkdev(pmem_major, "pmem");
-out:
return result;
}
@@ -590,12 +550,9 @@ static void __exit pmem_exit(void)
{
struct pmem_device *pmem, *next;
- blk_unregister_region(MKDEV(pmem_major, 0), 0);
-
list_for_each_entry_safe(pmem, next, &pmem_devices, pmem_list)
pmem_del_one(pmem);
- unregister_blkdev(pmem_major, "pmem");
pr_info("pmem: module unloaded\n");
}
--
1.9.3
next prev parent reply other threads:[~2014-08-26 17:36 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-13 12:08 [RFC 0/9] pmem: Support for "struct page" with Persistent Memory storage Boaz Harrosh
2014-08-13 12:10 ` [RFC 1/9] prd: Initial version of Persistent RAM Driver Boaz Harrosh
2014-08-13 12:11 ` [RFC 2/9] prd: add support for rw_page() Boaz Harrosh
2014-08-13 12:12 ` [RFC 3/9] prd: Add getgeo to block ops Boaz Harrosh
2014-08-13 12:14 ` [RFC 4/9] SQUASHME: prd: Fixs to getgeo Boaz Harrosh
2014-08-20 22:10 ` Ross Zwisler
2014-08-21 9:47 ` Boaz Harrosh
2014-08-13 12:16 ` [RFC 5/9] SQUASHME: prd: Last fixes for partitions Boaz Harrosh
2014-08-14 13:04 ` Boaz Harrosh
2014-08-14 13:16 ` Matthew Wilcox
2014-08-14 13:55 ` Boaz Harrosh
2014-08-14 13:07 ` [PATCH 5/9 v2] " Boaz Harrosh
2014-08-25 20:10 ` Ross Zwisler
2014-08-26 8:18 ` Boaz Harrosh
2014-08-26 17:36 ` Boaz Harrosh [this message]
2014-08-26 20:34 ` Ross Zwisler
2014-08-27 9:41 ` Boaz Harrosh
2014-08-27 4:38 ` Matthew Wilcox
2014-08-27 9:55 ` Boaz Harrosh
2014-08-27 12:46 ` Matthew Wilcox
2014-08-27 13:01 ` Boaz Harrosh
2014-08-20 23:03 ` [RFC 5/9] " Ross Zwisler
2014-08-21 10:05 ` Boaz Harrosh
2014-08-13 12:18 ` [RFC 6/9] SQUASHME: prd: Let each prd-device manage private memory region Boaz Harrosh
2014-08-21 16:57 ` Ross Zwisler
2014-08-13 12:20 ` [RFC 7/9] SQUASHME: prd: Support of multiple memory regions Boaz Harrosh
2014-08-25 23:02 ` Ross Zwisler
2014-08-13 12:21 ` [RFC 8/9] mm: export sparse_add/remove_one_section Boaz Harrosh
2014-08-13 12:26 ` [RFC 9/9] prd: Add support for page struct mapping Boaz Harrosh
2014-08-15 20:28 ` Toshi Kani
2014-08-17 9:17 ` Boaz Harrosh
2014-08-18 19:48 ` Toshi Kani
2014-08-19 8:40 ` Boaz Harrosh
2014-08-19 16:49 ` Toshi Kani
2014-08-22 14:36 ` Dave Hansen
2014-09-09 16:16 ` Boaz Harrosh
2014-09-09 16:29 ` Dave Hansen
2014-08-20 20:13 ` [RFC 0/9] pmem: Support for "struct page" with Persistent Memory storage Ross Zwisler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53FCC593.6020201@gmail.com \
--to=openosd@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=boaz@plexistor.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ross.zwisler@linux.intel.com \
--cc=sagi@plexistor.com \
--cc=willy@linux.intel.com \
--cc=yigal@plexistor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).