* Re: Raid 1 vs Raid 10 single thread performance
From: David Brown @ 2014-09-12 8:49 UTC (permalink / raw)
To: Bostjan Skufca, linux-raid
In-Reply-To: <CAEp_DRAVPBvA34kgdjWqO6f6489SbmHQf-dFXC_SwSQd8e0C2w@mail.gmail.com>
On 10/09/14 23:24, Bostjan Skufca wrote:
> Hi,
>
> I have a simple question:
> - Where is the code that is used for actual RAID 10 creation? In
> kernel or in mdadm?
>
>
> Explanation:
>
> I was dissatisfied with single-threaded RAID 1 sequential read
> performance (basically boils down to the speed of one disk). I figured
> that instead of using level 1 I could create RAID level 10 and use two
> equally-sized partitions on each drive (instead of one).
>
> It turns out that if array is created properly, it is capable of
> sequential reads at almost 2x single device speed, as expected (on
> SSD!) and what would anyone expect from ordinary RAID 1.
>
> What does "properly" actually mean?
> I was doing some benchmarks with various raid configurations and
> figured out that the order of devices submitted to creation command is
> significant. It also makes raid10 created in such mode reliable or
> unreliable to a device failure (not partition failure, device failure,
> which means that two raid underlying devices fail at once).
>
> Sum:
> - if such array is created properly, it has redundancy in place and
> performs as expected
> - if not, it performs as raid1 and fails with one physical disk failure
>
> I am trying to find the code responsible for creation of RAID 10 in
> order to try and make it more inteligent about where to place RAID 10
> parts if it gets a list of devices to use, and some of those devices
> are on the same physical disks.
>
> Thanks for hints,
> b.
>
>
>
> PS: More details about testing is available here, but be warned, it is
> still a bit hectic to read:
> http://blog.a2o.si/2014/09/07/linux-software-raid-why-you-should-always-use-raid-10-instead-of-raid-1/
Hi,
First let me applaud your enthusiasm for trying to inform people about
raid in your blog, your interest in investigating different ideas in the
hope of making md raid faster and/or easier and/or safer.
Then let me tell you your entire blog post is wasted, because md already
has a solution that is faster, easier and safer than anything you have
come up with so far.
You are absolutely correct about the single-threaded read performance of
raid1 pairs - for a number of reasons, a single thread read will get
reads from only one disk. This is not a problem in many cases, because
you often have multiple simultaneous reads on "typical" systems with
raid1. But for some cases, such as a high performance desktop, it can
be a limitation.
You are also correct that the solution is basically to split the drives
into two parts, pair up halves from each disk as raid1 mirrors, and
stripe the two mirrors as raid0.
And you are correct that you have to get the sets right, or you will may
lose redundancy and/or speed.
Fortunately, Neil and the other md raid developers are way ahead of you.
Neil gave you the pointers in one of his replies, but I suspect you did
not understand that Linux raid10 is not limited to the arrangement of
traditional raid10, and thus did not see his point.
md raid and mdadmin already support a very flexible form of raid10.
Unlike traditional raid10 that requires a multiple of 4 disks, Linux
raid10 can work with /any/ number of disks greater than 1. There are
various layouts that can be used for this - the Wikipedia entry gives
some useful diagrams:
<http://en.wikipedia.org/wiki/Non-standard_RAID_levels#Linux_MD_RAID_10>
You can also read about it in the mdadm manual page, and various
documents and resources around the web.
In your particular case, what you want is to use "--layout raid10,f2" on
your two disks. This asks md to split each disk (or the partitions you
use) into two parts, without creating any new partitions. The first
half of disk 1 is mirrored with the second half of disk 2, and vice
versa, then these mirrors are striped. This is very similar to the
layout you are trying to achieve, except for four points:
The mirrors are crossed-over, so that a first half is mirrored with a
second half. This makes no difference on an SSD, but makes a huge
difference on a hard disk.
mdadm and md raid get the ordering right every time - there is no need
to worry about the ordering of the two disks.
You don't have to have extra partitions, automatic detection works, and
the layout has one less layer, meaning less complexity and lower latency
and overheads.
md raid knows more about the layout, and can use it to optimise the speed.
In particular, md will (almost) always read from the outer halves of the
disks. On a hard disk, this can be twice the speed of the inner layers.
Obviously you pay a penalty in writing when you have such an arrangement
- writes need to go to both disks, and involve significant head
movement. There are other raid10 layouts that have lower streamed read
speeds but also lower write latencies (choose the balance you want).
With this in mind, I hope you can try out raid10,f2 layout on your
system and then change your blog to show how easy this all is with md
raid, how practical it is for a fast workstation or desktop, and how
much faster such a setup is than anything that can be achieved with
hardware raid cards or anything other than md raid.
mvh.,
David
^ permalink raw reply
* Re: Status of discard support in MD RAID
From: David Brown @ 2014-09-12 9:03 UTC (permalink / raw)
To: Chris Murphy, Brassow Jonathan; +Cc: linux-raid@vger.kernel.org Raid, NeilBrown
In-Reply-To: <26CB8B36-9CD9-4EE0-BFF2-4B183DBDD033@colorremedies.com>
On 12/09/14 02:46, Chris Murphy wrote:
>
> On Sep 11, 2014, at 5:38 PM, Brassow Jonathan <jbrassow@redhat.com>
> wrote:
>
>> Neil (or anyone else),
>>
>> I know that trim/discard support was added back in 2012 (commit
>> 9db90880). However, I thought there were still issues regarding
>> what happens when various sync operations occur. I'd like to turn
>> on discard support in dm-raid.c (a oneline patch) if things are in
>> order. I can enable any, all or none depending on your
>> recommendation. (I assume RAID1/10 is easier than the parity
>> RAIDs.)
>
> If all the controller and drive support it then it should pass
> through, but there's the problem whether the SSD supports
> deterministic trim. If it doesn't, a check check > md/sync_action
> will report mismatches in md/mismatch_cnt; and a repair will probably
> corrupt the volume. So you can still use trim with a drive that
> returns non-deterministic results with raid0/1/10, but you can't rely
> on the result of md/mismatch_cnt and you can't do repair type
> scrubs.
>
> For raid5/6, it's a problem to use trim if the drive returns
> non-deterministically for trimmed blocks. I'd think that in addition
> to DRAT being supported, it'd need to support DZAT.
>
> smartctl --identify=wb /dev/diskX | grep -i trim
>
>
> Chris Murphy
>
Would it be possible to change trim/discard commands into write zero
blocks for some SSDs? A number of SSD controllers support transparent
compression, so writing large batches of zeros will result in very small
writes to the actual flash, and the SSD controller will be able to
recycle flash used by the overwritten logical blocks just as if they
were trimmed. Obviously writing zeros will take longer in transfer than
trim commands, but the result on the disk would be similar and it would
be guaranteed deterministic.
David
^ permalink raw reply
* Re: Status of discard support in MD RAID
From: Brad Campbell @ 2014-09-12 9:26 UTC (permalink / raw)
To: David Brown, Chris Murphy, Brassow Jonathan
Cc: linux-raid@vger.kernel.org Raid, NeilBrown
In-Reply-To: <5412B6D7.1060400@hesbynett.no>
On 12/09/14 17:03, David Brown wrote:
> On 12/09/14 02:46, Chris Murphy wrote:
>>
>> On Sep 11, 2014, at 5:38 PM, Brassow Jonathan <jbrassow@redhat.com>
>> wrote:
>>
>>> Neil (or anyone else),
>>>
>>> I know that trim/discard support was added back in 2012 (commit
>>> 9db90880). However, I thought there were still issues regarding
>>> what happens when various sync operations occur. I'd like to turn
>>> on discard support in dm-raid.c (a oneline patch) if things are in
>>> order. I can enable any, all or none depending on your
>>> recommendation. (I assume RAID1/10 is easier than the parity
>>> RAIDs.)
>>
>> If all the controller and drive support it then it should pass
>> through, but there's the problem whether the SSD supports
>> deterministic trim. If it doesn't, a check check > md/sync_action
>> will report mismatches in md/mismatch_cnt; and a repair will probably
>> corrupt the volume. So you can still use trim with a drive that
>> returns non-deterministic results with raid0/1/10, but you can't rely
>> on the result of md/mismatch_cnt and you can't do repair type
>> scrubs.
>>
>> For raid5/6, it's a problem to use trim if the drive returns
>> non-deterministically for trimmed blocks. I'd think that in addition
>> to DRAT being supported, it'd need to support DZAT.
>>
>> smartctl --identify=wb /dev/diskX | grep -i trim
>>
>>
>> Chris Murphy
>>
>
> Would it be possible to change trim/discard commands into write zero
> blocks for some SSDs? A number of SSD controllers support transparent
> compression, so writing large batches of zeros will result in very small
> writes to the actual flash, and the SSD controller will be able to
> recycle flash used by the overwritten logical blocks just as if they
> were trimmed. Obviously writing zeros will take longer in transfer than
> trim commands, but the result on the disk would be similar and it would
> be guaranteed deterministic.
>
I have 6 drives here. 3 Intel 330's and 3 Samsung 830's. The Intel 330s
compress transparently (Sandforce controllers). They also support
deterministic and return 0 on trimmed areas. The Samsungs don't compress
and don't support deterministic or 0 on trimmed areas.
They are in a 6 drive RAID10 and I just put up with the massive mismatch
count. Contrary to what Chris wrote, there is no damage caused by a
repair type of scrub. Depending on the direction it either copies 0's to
the Samsungs or random garbage to the Intels. It simply ends up writing
to all the trimmed areas, so I don't do it.
Frankly if I considered this an issue I'd just go and replace the
Samsungs with something newer, but as it has no practical ramifications
in the real world I'll use them until I either run out of space or I
wear them out.
I certainly don't believe it is worth of any form of special casing in
the block, RAID or filesystem code. Just tell people that if they want
to use SSD's in RAID and get properly working trim then all drives need
to support return deterministic and return 0 on trim.
As it is, I get this once a month :System Events
=-=-=-=-=-=-=
Sep 7 02:12:49 srv mdadm[6341]: RebuildFinished event detected on md
device /dev/md2, component device mismatches found: 7100032 (on raid
level 10)
The machine is on a serious UPS and gets rebooted about twice a year, so
I'm not afraid of unclean shutdowns.
Regards,
Brad
^ permalink raw reply
* Re: Status of discard support in MD RAID
From: Roman Mamedov @ 2014-09-12 9:39 UTC (permalink / raw)
To: Chris Murphy; +Cc: Brassow Jonathan, linux-raid@vger.kernel.org Raid, NeilBrown
In-Reply-To: <26CB8B36-9CD9-4EE0-BFF2-4B183DBDD033@colorremedies.com>
[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]
On Thu, 11 Sep 2014 18:46:04 -0600
Chris Murphy <lists@colorremedies.com> wrote:
> If it doesn't, a check check > md/sync_action will report mismatches in
> md/mismatch_cnt; and a repair will probably corrupt the volume.
At least with RAID1/10, why would it?
> and you can't do repair type scrubs.
If the FS issues TRIM on a certain region, by definition it no longer cares
about what's stored there (as it's is no longer in use by the FS). So even if
a repair ends up coping some data from one SSD to another, in effect changing
the contents of that region, this should not affect anything whatsoever from
the FS standpoint.
Technically perhaps that still counts as a "corruption", but not of anything
in the filesystem metadata or user data, just of unused regions. So not as
scary as it first sounds.
The only case where you'd run into problems with this, is if some apps expect
to read back zeroes on TRIM'ed regions, e.g. Qemu in the "detect-zeroes=unmap"
mode. But using that would be dangerous even on a single SSD with
non-deterministic TRIM, so mdraid changes nothing here.
--
With respect,
Roman
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: frequent disk activity with mdadm-3.3
From: Marco Schindler @ 2014-09-12 12:15 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-raid
In-Reply-To: <164CD08B-99CA-4007-855A-7B0561B4EC76@gmail.com>
ok, that’s interesting.
the process id is _not_ mdadm daemon and it looks like the spindown itself is triggering the process.
ps ax | grep mdadm
28956 ? Ss 0:00 mdadm --monitor --scan --daemonise --pid-file /var/run/mdadm.pid --syslog
grep sda /var/log/messages
Sep 12 13:55:04 alina spindown: sda is now inactive.
Sep 12 13:55:09 alina kernel: mdadm(29737): READ block 3907028992 on sda (8 sectors)
Sep 12 13:55:17 alina kernel: mdadm(29737): READ block 3907029152 on sda (8 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 0 on sda (8 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 3907029167 on sda (1 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 3907029166 on sda (1 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 0 on sda (1 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 0 on sda (1 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 3907029152 on sda (8 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 0 on sda (8 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
Sep 12 13:56:12 alina spindown: sda is now active.
here’s the output of blktrace -d /dev/sda during that time.
https://dl.dropboxusercontent.com/u/3464720/blktrace.tar.bz2
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Speeding up reading with RAID1 and --write-mostly
From: martin f krafft @ 2014-09-13 6:01 UTC (permalink / raw)
To: linux-raid
[-- Attachment #1: Type: text/plain, Size: 1075 bytes --]
Hello,
my laptop still has a rotational disk, and also a MMC reader, which
I never use. Having seen some SSD laptops do things blazingly fast,
I wondered if I couldn't use the MMC to help.
Assuming there is a MMC fast enough out there, how about creating
a RAID1 across MMC and parts of the rotational disk, with the
rotational disk flagged --write-mostly? This RAID would then hold
the system, while the data would sit on the rotational disk.
The theory here is that writing is going to be expensive either way,
but most of system use is reading anyway.
Does this sound like an idea worth pursuing? I am asking because
I don't really want to experiment using this laptop, which is
currently my only machine. Have you done this? Have you any
thoughts? Or is this just a bad idea?
I would appreciate CCs on replies.
--
@martinkrafft | http://madduck.net/ | http://two.sentenc.es/
"without a god, life is only a matter of opinion."
-- douglas adams
spamtraps: madduck.bogus@madduck.net
[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current) --]
[-- Type: application/pgp-signature, Size: 1107 bytes --]
^ permalink raw reply
* Re: Speeding up reading with RAID1 and --write-mostly
From: Ethan Wilson @ 2014-09-13 11:56 UTC (permalink / raw)
To: linux-raid
In-Reply-To: <20140913060143.GA15849@fishbowl.rw.madduck.net>
On 13/09/2014 08:01, martin f krafft wrote:
> Assuming there is a MMC fast enough out there, how about creating
> a RAID1 across MMC and parts of the rotational disk, with the
> rotational disk flagged --write-mostly? This RAID would then hold
> the system, while the data would sit on the rotational disk.
1) Firstly, MMC, SD etc are all very slow in random access. They are
optimized for physical size and not for speed.
2) Secondly, in order to use --write-mostly, you need two devices of the
same size, so you need an MMC as big as your HDD.
Something different from (2) is called SSD-caching, and in Linux kernel
there are two approaches to do that, one is dm-cache and the other is
bcache. Both are very young and I don't know how much stable.
^ permalink raw reply
* Re: Speeding up reading with RAID1 and --write-mostly
From: martin f krafft @ 2014-09-13 16:23 UTC (permalink / raw)
To: linux-raid@vger.kernel.org
In-Reply-To: <CAH3kUhGEaon77fpNm2mjRwPbNMZe9BLK3eA6LTB4xQeg0hMF-Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 600 bytes --]
also sprach Roberto Spadim <roberto@spadim.com.br> [2014-09-13 13:56 +0200]:
> Try a bcache or something like it
The problem with a cache is that the data have to be read once from
the slow disk anyway, whereas I am proposing to keep a shadow copy
on rotational disk, really, just in case the MMC may need to be
removed at some point.
--
@martinkrafft | http://madduck.net/ | http://two.sentenc.es/
"a fundamentalist is someone who hates sin more than he loves virtue."
-- john h. schaar
spamtraps: madduck.bogus@madduck.net
[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current) --]
[-- Type: application/pgp-signature, Size: 1107 bytes --]
^ permalink raw reply
* Re: Status of discard support in MD RAID
From: Chris Murphy @ 2014-09-13 20:19 UTC (permalink / raw)
To: Roman Mamedov; +Cc: linux-raid@vger.kernel.org Raid
In-Reply-To: <20140912153915.473bc562@natsu>
On Sep 12, 2014, at 3:39 AM, Roman Mamedov <rm@romanrm.net> wrote:
> On Thu, 11 Sep 2014 18:46:04 -0600
> Chris Murphy <lists@colorremedies.com> wrote:
>
>> If it doesn't, a check check > md/sync_action will report mismatches in
>> md/mismatch_cnt; and a repair will probably corrupt the volume.
>
> At least with RAID1/10, why would it?
It's a good question.
On the one hand:
ftp://ftp.t10.org/t10/document.08/08-347r1.pdf
In particular slides 5, 8, 9.
And then on the other hand:
https://lkml.org/lkml/2010/11/19/193
It's an overstatement to have said "repair will probably corrupt" when everything is working normally. I can't know that. What happens in the case of a crash, power failure, or a drive that dies? If drive 1of2 fully dies, then the user has a more certain outcome, at least it's one non-deterministic drive 2of2 remaining to use as a source to rebuild with a new drive.
But the non-deterministic output from SSD trimmed blocks means the user can't depend on raid mechanism to confirm whether the rebuild worked. There will always be mismatches on check, and we have no way of knowing if those mismatches occur only in trimmed areas that we don't care about, or in data/metadata areas that we do care about. What's the work around? Separately degrade mount each mirror and produce a file checksum list and compare them? Ick.
ZFS and Btrfs wouldn't get tripped up, because their scrubs only operate on in-use blocks. So that's also a plausible work around for non-deterministic trim. But I don't know how well tested delete followed by trim is on either of them. Like Ted says, the filesystem has to be certain the delete has committed to stable media before issuing trim or all bets are off.
>
>> and you can't do repair type scrubs.
>
> If the FS issues TRIM on a certain region, by definition it no longer cares
> about what's stored there (as it's is no longer in use by the FS). So even if
> a repair ends up coping some data from one SSD to another, in effect changing
> the contents of that region, this should not affect anything whatsoever from
> the FS standpoint.
That's true, it should not, so long as everything else is working normally and correctly. But we still lose the ability to verify the veracity of the repair.
Chris Murphy
^ permalink raw reply
* seems like a deadlock in workqueue when md do a flush
From: Vaughan Cao @ 2014-09-14 16:15 UTC (permalink / raw)
To: linux-raid; +Cc: Tejun Heo, neilb, vaughan.cao
Hi Tejun/Neil,
@ INFO: task kjournald:4931 blocked for more than 120 seconds.
@ "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
@ kjournald D ffffffff815b9c40 0 4931 2 0x00000000
@ ffff8811d4b7baa8 0000000000000046 ffff8811d4b7bfd8 0000000000013fc0
@ ffff8811d4b7a010 0000000000013fc0 0000000000013fc0 0000000000013fc0
@ ffff8811d4b7bfd8 0000000000013fc0 ffffffff818b2420 ffff8811d8a20140
@ Call Trace:
@ [<ffffffff81594729>] schedule+0x29/0x70
@ [<ffffffff81460a46>] md_flush_request+0x86/0x120
@ [<ffffffff8118c27d>] ? mem_cgroup_charge_common+0x4d/0x60
@ [<ffffffff81083730>] ? wake_up_bit+0x40/0x40
@ [<ffffffff8118c3cd>] ? mem_cgroup_cache_charge+0x7d/0x90
@ [<ffffffffa004c6eb>] raid0_make_request+0x11b/0x200 [raid0]
@ [<ffffffff812666ad>] ? generic_make_request_checks+0x1ad/0x400
@ [<ffffffff814607cc>] md_make_request+0xdc/0x240
@ [<ffffffff81131e55>] ? mempool_alloc_slab+0x15/0x20
@ [<ffffffff81131fc0>] ? mempool_alloc+0x60/0x170
@ [<ffffffff812669ca>] generic_make_request+0xca/0x100
@ [<ffffffff81266a79>] submit_bio+0x79/0x160
@ [<ffffffff811c9245>] ? bio_alloc_bioset+0x65/0x120
@ [<ffffffff811c3fd3>] submit_bh+0x133/0x200
@ [<ffffffff811c6113>] __sync_dirty_buffer+0x53/0xd0
@ [<ffffffffa00a38e9>] journal_commit_transaction+0xda9/0x1080 [jbd]
@ [<ffffffff8106e7cc>] ? lock_timer_base+0x3c/0x70
@ [<ffffffff8106ed1b>] ? try_to_del_timer_sync+0x5b/0x70
@ [<ffffffffa00a7c25>] kjournald+0xf5/0x280 [jbd]
@ [<ffffffff81083730>] ? wake_up_bit+0x40/0x40
@ [<ffffffffa00a7b30>] ? commit_timeout+0x10/0x10 [jbd]
@ [<ffffffff81082e7e>] kthread+0xce/0xe0
@ [<ffffffff81082db0>] ? kthread_freezable_should_stop+0x70/0x70
@ [<ffffffff8159e1ac>] ret_from_fork+0x7c/0xb0
@ [<ffffffff81082db0>] ? kthread_freezable_should_stop+0x70/0x70
I'm facing a strang case which looks like a deadlock in workqueue. Could
you show me any idea on how to step further?
The case is we create a md device of type raid0 using two LUNs, mount it
as ext3 with option barrier=1,data=ordered. The two LUNs are like below:
@ >> sd 1:2:0:0: [sdb] Write cache: enabled, read cache: disabled,
doesn't support DPO or FUA
we use an kernel similar to v3.10.x without per-pool workqueue
implementation and backported the commit 7b7a866.
The case where many dio_aio_complete_work are waiting for the flush_bio
to complete, this bio queue an work item and wait, while the work item
is pending in the worklist but no running workers in this worker_pool
and no idle worker thread either. I'm guessing it's a bug relative to
the missing idle workers while there is still pending works on the
queue. maybe there is no idle worker when wake_up_worker(pool) is called.
This is a vmcore from our customer after the block issue is detected. I
haven't reproduce it locally, but the customer is easy to produce it in
their environment. If you need more information, please let me know.
commit 7b7a8665edd8db733980389b098530f9e4f630b2
Author: Christoph Hellwig <hch@infradead.org>
Date: Wed Sep 4 15:04:39 2013 +0200
direct-io: Implement generic deferred AIO completions
static void dio_bio_end_aio(struct bio *bio, int error)
{
....
if (dio->result && dio->defer_completion) {
INIT_WORK(&dio->complete_work,
dio_aio_complete_work);
queue_work(dio->inode->i_sb->s_dio_done_wq,
&dio->complete_work);
....
}
Below is some debug from the vmcore.
@ .
@ void md_flush_request(struct mddev *mddev, struct bio *bio)
@ {
@ spin_lock_irq(&mddev->write_lock);
@ wait_event_lock_irq(mddev->sb_wait,
@ !mddev->flush_bio,
@ mddev->write_lock);
@ mddev->flush_bio = bio;
@ spin_unlock_irq(&mddev->write_lock);
@ .
@ INIT_WORK(&mddev->flush_work, submit_flushes);
@ queue_work(md_wq, &mddev->flush_work);
@ }
@ EXPORT_SYMBOL(md_flush_request);
@ Note md0 is a 7T size disk, with ext3 filesystem.
@ .
@ /dev/md0 /ora_data ext3
rw,noatime,errors=continue,barrier=1,data=ordered 0 0
@ .
@ md: bind<sdc1>
@ md: bind<sdb1>
@ md: raid0 personality registered for level 0
@ md/raid0:md0: md_size is 14036237568 sectors.
@ md: RAID0 configuration for md0 - 1 zone
@ md: zone0=[sdb1/sdc1]
@ zone-offset= 0KB, device-offset= 0KB,
size=7018118784KB
@ md0: detected capacity change from 0 to 7186553634816
@ Analyze the vmcore, md0 indeed has a flush_bio pending.
@ .
@ struct mddev = 0xffff8811d1441000, flush_bio = 0xffff88102f6536c0,
@ struct bio {
@ bi_sector = 0x0,
@ bi_next = 0x0,
@ bi_bdev = 0xffff8811d24e5080,
@ bi_bdev_orig = 0x0,
@ bi_flags = 0xf000000000000001,
@ bi_rw = 0x1411, <== (REQ_FLUSH|REQ_NOIDLE|REQ_WRITE|REQ_SYNC)
@ bi_vcnt = 0x0,
@ bi_idx = 0x0,
@ bi_phys_segments = 0x0,
@ bi_size = 0x0,
@ bi_seg_front_size = 0x0,
@ bi_seg_back_size = 0x0,
@ bi_end_io = 0xffffffff81269d10 <bio_end_flush>,
@ bi_private = 0xffff88115b9fdcd8,
@ bi_ioc = 0x0,
@ bi_css = 0x0,
@ bi_integrity = 0x0,
@ bi_max_vecs = 0x0,
@ bi_cnt = {
@ counter = 0x2
@ },
@ bi_io_vec = 0x0,
@ bi_pool = 0xffff8811d8696240,
@ bi_inline_vecs = 0xffff88102f653748
@ }
@ This made other bios with REQ_FLUSH set all blocked, e.g. from kjournald.
@ kworker/15:3 sent the culprit flush_bio, insert its flush_work into
the cwq
@ of cpu15, but the work item is pending and never get run. In the
meanwhile,
@ all running workers on this cpu is waiting for mddev->flush_bio to be
@ cleared, that is, the pending work item(mddev->flush_work) to complete.
@ Now, the point is why this work item can't get a chance to run.
@ .
@ PID: 20757 TASK: ffff881113fea040 CPU: 15 COMMAND: "kworker/15:3"
@ #0 [ffff88115b9fdac8] __schedule at ffffffff815940a2
@ #1 [ffff88115b9fdb60] schedule at ffffffff81594729
@ #2 [ffff88115b9fdb70] schedule_timeout at ffffffff815927c5
@ #3 [ffff88115b9fdc10] wait_for_common at ffffffff815945ca
@ #4 [ffff88115b9fdcb0] wait_for_completion at ffffffff815946fd
@ #5 [ffff88115b9fdcc0] blkdev_issue_flush at ffffffff81269ce0
@ #6 [ffff88115b9fdd20] ext3_sync_file at ffffffffa00be792 [ext3]
@ #7 [ffff88115b9fdd70] vfs_fsync_range at ffffffff811c15de
@ #8 [ffff88115b9fdd80] generic_write_sync at ffffffff811c1641
@ #9 [ffff88115b9fdd90] dio_complete at ffffffff811cceeb
@ #10 [ffff88115b9fddd0] dio_aio_complete_work at ffffffff811cd064
@ #11 [ffff88115b9fdde0] process_one_work at ffffffff8107baf0
@ #12 [ffff88115b9fde40] worker_thread at ffffffff8107db2e
@ #13 [ffff88115b9fdec0] kthread at ffffffff81082e7e
@ #14 [ffff88115b9fdf50] ret_from_fork at ffffffff8159e1ac
@ .
@ mddev=0xffff8811d1441000
@ struct mddev {
@ ...
@ flush_bio = 0xffff88102f6536c0,
@ flush_pending = {
@ counter = 0x0
@ },
@ flush_work = {
@ data = {
@ counter =
0xffff88123fdf8005 <==(WORK_STRUCT_PENDING|WORK_STRUCT_CWQ)
@ },
@ entry = {
@ next = 0xffff8810e74a2130,
@ prev = 0xffff8810221190f0
@ },
@ func = 0xffffffff81463640 <submit_flushes>
@ },
@ ...
@ }
:!cat cwq.0xffff88123fdf8000
struct cpu_workqueue_struct {
pool = 0xffff88123fdee910,
wq = 0xffff8811d80b5480,
work_color = 0x0,
flush_color = 0xffffffff,
nr_in_flight = {0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0},
nr_active = 0x1,
max_active = 0x100,
delayed_works = {
next = 0xffff88123fdf8060,
prev = 0xffff88123fdf8060
}
}
:!cat worker_pool.x.0xffff88123fdee910
struct worker_pool {
gcwq = 0xffff88123fdee700,
flags = 0x0,
worklist = {
next = 0xffff8811324b2870,
prev = 0xffffffff81904f08 <psinfo_cleanup+8>
},
nr_workers = 0x1b,
nr_idle = 0x0,
idle_list = {
next = 0xffff88123fdee938,
prev = 0xffff88123fdee938
},
idle_timer = {
entry = {
next = 0x0,
prev = 0xdead000000200200
},
expires = 0x104d7dc00,
base = 0xffff8811d8428001,
function = 0xffffffff8107a930 <idle_worker_timeout>,
data = 0xffff88123fdee910,
slack = 0xffffffff,
start_pid = 0xffffffff,
start_site = 0x0,
start_comm =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
},
mayday_timer = {
entry = {
next = 0x0,
prev = 0xdead000000200200
},
expires = 0x104cfa071,
base = 0xffff8811d8428000,
function = 0xffffffff8107a830 <gcwq_mayday_timeout>,
data = 0xffff88123fdee910,
slack = 0xffffffff,
start_pid = 0xffffffff,
start_site = 0x0,
start_comm =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
},
assoc_mutex = {
count = {
counter = 0x1
},
wait_lock = {
{
rlock = {
raw_lock = {
{
head_tail = 0x0,
tickets = {
head = 0x0,
tail = 0x0
}
}
}
}
}
},
wait_list = {
next = 0xffff88123fdee9f0,
prev = 0xffff88123fdee9f0
},
owner = 0x0,
spin_mlock = 0x0
},
worker_ida = {
idr = {
top = 0xffff8811d8bdf2b0,
id_free = 0x0,
layers = 0x1,
id_free_cnt = 0x0,
lock = {
{
rlock = {
raw_lock = {
{
head_tail = 0x1b001b,
tickets = {
head = 0x1b,
tail = 0x1b
}
}
}
}
}
}
},
free_bitmap = 0x0
}
}
@ .
@ crash> ps | awk '{if($0 ~ "kworker" && $3 == "15")print}'
@ .
@ 86 2 15 ffff8811d8420240 IN 0.0 0 0
@ [kworker/15:0H]
@ 10215 2 15 ffff88117e184140 IN 0.0 0 0
@ [kworker/15:1H]
@ 15577 2 15 ffff881137982100 UN 0.0 0 0
@ [kworker/15:98]
@ 15597 2 15 ffff8810197d0040 UN 0.0 0 0
@ [kworker/15:118]
@ 16212 2 15 ffff881033216040 UN 0.0 0 0
@ [kworker/15:32]
@ 16229 2 15 ffff8810224b8380 UN 0.0 0 0
@ [kworker/15:49]
@ 17485 2 15 ffff88102e5a0480 UN 0.0 0 0 [kworker/15:0]
@ 18774 2 15 ffff88115d9ca300 UN 0.0 0 0 [kworker/15:4]
@ 18777 2 15 ffff88102d854100 UN 0.0 0 0 [kworker/15:7]
@ 18779 2 15 ffff8810314d01c0 UN 0.0 0 0 [kworker/15:9]
@ 18780 2 15 ffff88102238a340 UN 0.0 0 0
@ [kworker/15:10]
@ 18796 2 15 ffff88102e7c8500 UN 0.0 0 0
@ [kworker/15:28]
@ 19958 2 15 ffff881034636040 UN 0.0 0 0 [kworker/15:6]
@ 19959 2 15 ffff88101e0f0300 UN 0.0 0 0 [kworker/15:8]
@ 19960 2 15 ffff881017050180 UN 0.0 0 0
@ [kworker/15:11]
@ 19961 2 15 ffff88101a28e1c0 UN 0.0 0 0
@ [kworker/15:12]
@ 19962 2 15 ffff881016e24200 UN 0.0 0 0
@ [kworker/15:14]
@ 20211 2 15 ffff881032210140 UN 0.0 0 0
@ [kworker/15:15]
@ 20212 2 15 ffff8810229a42c0 UN 0.0 0 0
@ [kworker/15:16]
@ 20755 2 15 ffff881028d38540 UN 0.0 0 0 [kworker/15:1]
@ 20756 2 15 ffff88102c9e25c0 UN 0.0 0 0 [kworker/15:2]
@ 20757 2 15 ffff881113fea040 UN 0.0 0 0 [kworker/15:3]
@ 20758 2 15 ffff8810330fe080 UN 0.0 0 0 [kworker/15:5]
@ 20759 2 15 ffff8810218220c0 UN 0.0 0 0
@ [kworker/15:13]
@ 20760 2 15 ffff88101a1b2100 UN 0.0 0 0
@ [kworker/15:17]
@ 20762 2 15 ffff88102cb98180 UN 0.0 0 0
@ [kworker/15:19]
@ 20763 2 15 ffff881016c9e1c0 UN 0.0 0 0
@ [kworker/15:20]
@ 20764 2 15 ffff8810344f8200 UN 0.0 0 0
@ [kworker/15:21]
@ 20765 2 15 ffff8810322aa240 UN 0.0 0 0
@ [kworker/15:22]
@ .
@ ## kworker/15:[01]H are in idle, others running workers, except
kworker/15:3,
@ have the same backtrace like this below:
@ .
@ PID: 20765 TASK: ffff8810322aa240 CPU: 15 COMMAND: "kworker/15:22"
@ #0 [ffff88117064ba48] __schedule at ffffffff815940a2
@ #1 [ffff88117064bae0] schedule at ffffffff81594729
@ #2 [ffff88117064baf0] md_flush_request at ffffffff81460a46
@ #3 [ffff88117064bb70] raid0_make_request at ffffffffa00836eb [raid0]
@ #4 [ffff88117064bbb0] md_make_request at ffffffff814607cc
@ #5 [ffff88117064bc20] generic_make_request at ffffffff812669ca
@ #6 [ffff88117064bc50] submit_bio at ffffffff81266a79
@ #7 [ffff88117064bcc0] blkdev_issue_flush at ffffffff81269cd8
@ #8 [ffff88117064bd20] ext3_sync_file at ffffffffa00be792 [ext3]
@ #9 [ffff88117064bd70] vfs_fsync_range at ffffffff811c15de
@ #10 [ffff88117064bd80] generic_write_sync at ffffffff811c1641
@ #11 [ffff88117064bd90] dio_complete at ffffffff811cceeb
@ #12 [ffff88117064bdd0] dio_aio_complete_work at ffffffff811cd064
@ #13 [ffff88117064bde0] process_one_work at ffffffff8107baf0
@ #14 [ffff88117064be40] worker_thread at ffffffff8107db2e
@ #15 [ffff88117064bec0] kthread at ffffffff81082e7e
@ #16 [ffff88117064bf50] ret_from_fork at ffffffff8159e1ac
crash> p pool_nr_running
PER-CPU DATA TYPE:
atomic_t pool_nr_running[2];
PER-CPU ADDRESSES:
[0]: ffff88123fc13f80
[1]: ffff88123fc33f80
[2]: ffff88123fc53f80
[3]: ffff88123fc73f80
[4]: ffff88123fc93f80
[5]: ffff88123fcb3f80
[6]: ffff88123fcd3f80
[7]: ffff88123fcf3f80
[8]: ffff88123fd13f80
[9]: ffff88123fd33f80
[10]: ffff88123fd53f80
[11]: ffff88123fd73f80
[12]: ffff88123fd93f80
[13]: ffff88123fdb3f80
[14]: ffff88123fdd3f80
[15]: ffff88123fdf3f80
crash> atomic_t ffff88123fdf3f80
struct atomic_t {
counter = 0
}
crash> list -o work_struct.entry -s work_struct -x -H ffff88123fdee920
ffff8811324b2868
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff881159922130,
prev = 0xffff88123fdee920
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff881159922128
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff881135ce1b30,
prev = 0xffff8811324b2870
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff881135ce1b28
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff881022143130,
prev = 0xffff881159922130
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff881022143128
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88115b8623b0,
prev = 0xffff881135ce1b30
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88115b8623a8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff8810261ecdb0,
prev = 0xffff881022143130
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff8810261ecda8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88104f74ed70,
prev = 0xffff88115b8623b0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88104f74ed68
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff8810221190f0,
prev = 0xffff8810261ecdb0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff8810221190e8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff8811d14413d0,
prev = 0xffff88104f74ed70
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff8811d14413c8
struct work_struct {
data = {
counter = 0xffff88123fdf8005
},
entry = {
next = 0xffff8810e74a2130,
prev = 0xffff8810221190f0
},
func = 0xffffffff81463640 <submit_flushes>
}
ffff8810e74a2128
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff881022091870,
prev = 0xffff8811d14413d0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff881022091868
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff8810e74a2630,
prev = 0xffff8810e74a2130
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff8810e74a2628
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88103460e370,
prev = 0xffff881022091870
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88103460e368
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88102a71cb30,
prev = 0xffff8810e74a2630
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88102a71cb28
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff8810e74c13b0,
prev = 0xffff88103460e370
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff8810e74c13a8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff881159a5a370,
prev = 0xffff88102a71cb30
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff881159a5a368
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88102245c3b0,
prev = 0xffff8810e74c13b0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88102245c3a8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff881113e9c8b0,
prev = 0xffff881159a5a370
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff881113e9c8a8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff8810222bfd70,
prev = 0xffff88102245c3b0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff8810222bfd68
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88102fd31af0,
prev = 0xffff881113e9c8b0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88102fd31ae8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88104f7dcb30,
prev = 0xffff8810222bfd70
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88104f7dcb28
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88102a59bb30,
prev = 0xffff88102fd31af0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88102a59bb28
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88104f7dc3b0,
prev = 0xffff88104f7dcb30
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88104f7dc3a8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88102fd310f0,
prev = 0xffff88102a59bb30
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88102fd310e8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff8810194878b0,
prev = 0xffff88104f7dc3b0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff8810194878a8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88102c5aab30,
prev = 0xffff88102fd310f0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88102c5aab28
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88102a71c630,
prev = 0xffff8810194878b0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88102a71c628
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88102245c130,
prev = 0xffff88102c5aab30
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88102245c128
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff8810225c7d70,
prev = 0xffff88102a71c630
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff8810225c7d68
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff881022143db0,
prev = 0xffff88102245c130
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff881022143da8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff881022119370,
prev = 0xffff8810225c7d70
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff881022119368
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff8810225c7870,
prev = 0xffff881022143db0
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff8810225c7868
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88101a238630,
prev = 0xffff881022119370
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88101a238628
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88103307ab30,
prev = 0xffff8810225c7870
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88103307ab28
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88102d9490f0,
prev = 0xffff88101a238630
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88102d9490e8
struct work_struct {
data = {
counter = 0xffffe8ffffde0905
},
entry = {
next = 0xffff88123fdf4ef0,
prev = 0xffff88103307ab30
},
func = 0xffffffff811cd040 <dio_aio_complete_work>
}
ffff88123fdf4ee8
struct work_struct {
data = {
counter = 0xffff88123fdf7305
},
entry = {
next = 0xffff88123fdf0bc8,
prev = 0xffff88102d9490f0
},
func = 0xffffffffa004e9a0
}
ffff88123fdf0bc0
struct work_struct {
data = {
counter = 0xffff88123fdf7305
},
entry = {
next = 0xffff88123fdf0c68,
prev = 0xffff88123fdf4ef0
},
func = 0xffffffff8114dc90 <vmstat_update>
}
ffff88123fdf0c60
struct work_struct {
data = {
counter = 0xffff88123fdf7305
},
entry = {
next = 0xffffffff81904f08 <psinfo_cleanup+8>,
prev = 0xffff88123fdf0bc8
},
func = 0xffffffff81180200 <cache_reap>
}
ffffffff81904f00
struct work_struct {
data = {
counter = 0xffff88123fdf7305
},
entry = {
next = 0xffff88123fdee920,
prev = 0xffff88123fdf0c68
},
func = 0xffffffff8112e040 <psinfo_cleaner>
}
Thanks,
Vaughan
^ permalink raw reply
* Re: Question about RAID1 plug/unplug code
From: Alexander Lyakas @ 2014-09-14 17:52 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-raid, Yair Hershko
In-Reply-To: <20140912161649.09b2d898@notabene.brown>
Thanks, Neil.
We will try to see whether it is possible to reproduce the corruption
w/o the patch. And also test what performance implication the patch
has.
Alex.
On Fri, Sep 12, 2014 at 9:16 AM, NeilBrown <neilb@suse.de> wrote:
> On Thu, 11 Sep 2014 11:22:40 +0300 Alexander Lyakas <alex.bolshoy@gmail.com>
> wrote:
>
>> Hi Neil,
>>
>> On Wed, Sep 10, 2014 at 12:36 PM, NeilBrown <neilb@suse.de> wrote:
>> > On Wed, 10 Sep 2014 11:01:30 +0300 Alexander Lyakas <alex.bolshoy@gmail.com>
>> > wrote:
>> >
>> >> Hello Neil,
>> >>
>> >> On Tue, Sep 9, 2014 at 12:45 PM, NeilBrown <neilb@suse.de> wrote:
>> >> > On Tue, 9 Sep 2014 11:33:13 +0300 Alexander Lyakas <alex.bolshoy@gmail.com>
>> >> > wrote:
>> >> >
>> >> >> Hi Neil,
>> >> >>
>> >> >>
>> >> >> On Tue, Sep 9, 2014 at 4:45 AM, NeilBrown <neilb@suse.de> wrote:
>> >> >> > On Mon, 8 Sep 2014 16:55:52 +0300 Alexander Lyakas <alex.bolshoy@gmail.com>
>> >> >> > wrote:
>> >> >> >
>> >> >> >> Hi Neil,
>> >> >> >> We have been seeing high latency on the md/raid1 block device, due to
>> >> >> >> the fact that all WRITEs are handed off to raid1d thread. This thread
>> >> >> >> also calls bitmap_unplug(), which writes the bitmap synchronously.
>> >> >> >> While it waits for the bitmap, it cannot trigger other WRITEs waiting
>> >> >> >> in its pending_bio_list. This is especially seen with SSDs: MD's
>> >> >> >> latency is much higher that SSD latency (I have been stoned by Peter
>> >> >> >> Grandi when I brought up this issue previously for raid5).
>> >> >> >>
>> >> >> >> Then I have noticed the commit:
>> >> >> >>
>> >> >> >> commit f54a9d0e59c4bea3db733921ca9147612a6f292c
>> >> >> >> Author: NeilBrown <neilb@suse.de>
>> >> >> >> Date: Thu Aug 2 08:33:20 2012 +1000
>> >> >> >>
>> >> >> >> md/raid1: submit IO from originating thread instead of md thread.
>> >> >> >>
>> >> >> >> Looking at the code, I learned that to avoid switching into raid1d,
>> >> >> >> the caller has to use blk_start_plug/blk_finish_plug. So I added these
>> >> >> >> calls in our kernel module, which submits bios to MD. Results were
>> >> >> >> awesome, MD latency got down significantly.
>> >> >> >
>> >> >> > That's good to hear.
>> >> >> >
>> >> >> >>
>> >> >> >> So I have several questions about this plug/unplug thing.
>> >> >> >>
>> >> >> >> 1/ Originally this infrastructure was supposed to help IO schedulers
>> >> >> >> in merging requests. It is useful when one has a bunch of requests to
>> >> >> >> submit in one shot.
>> >> >> >
>> >> >> > That is exactly the whole point of plugging: allow the device to handle a
>> >> >> > batch of requests together instead of one at a time.
>> >> >> >
>> >> >> >> But in MD case, thus infrastructure is used for a different purpose:
>> >> >> >> not to merge requests (which may help bandwidth, but probably not
>> >> >> >> latency), but to avoid making raid1d a bottleneck, to be able to
>> >> >> >> submit requests from multiple threads in parallel, which brings down
>> >> >> >> latency significantly in our case. Indeed "struct blk_plug" has a
>> >> >> >> special "cb_list", which is used only by MD.
>> >> >> >
>> >> >> > I don't think the way md uses plugging is conceptually different from any
>> >> >> > other use: it is always about gathering a batch together.
>> >> >> > "cb_list" is handled by blk_check_plugged() which is also used by
>> >> >> > block/umem.c and btrfs.
>> >> >> >
>> >> >> > The base plugging code assumes that it is only gathering a batch of requests
>> >> >> > for a single device - if the target device changes then the batch is flushed.
>> >> >> > It also assumed that it was "struct request" that was batched.
>> >> >> > Devices like md that want to queue 'struct bio', something else was needed.
>> >> >> > Also with layered devices it can be useful to gather multiple batches for
>> >> >> > multiple layers.
>> >> >> > So I created "cb_list" etc and a more generic interface.
>> >> >> >
>> >> >> >> In my case I have only individual bios (not a bunch of bios), and I
>> >> >> >> after wrap them with plug/unplug, MD latency gets better. So we are
>> >> >> >> using the plug infrastructure for a different purpose.
>> >> >> >> Is my understanding correct? Was this your intention?
>> >> >> >
>> >> >> > I don't really understand what you are doing. There is no point in using
>> >> >> > plugging for individual bios. The main point for raid1 writes is to gather
>> >> >> > a lot of writes together so that all multiple bitmap bits can be set all at
>> >> >> > once.
>> >> >> > It should be possible to submit individual bios directly from make_request
>> >> >> > without passing them to raid1d and without using plugging.
>> >> >> Can you pls explain how it is possible?
>> >> >> You have this code for WRITEs:
>> >> >> cb = blk_check_plugged(raid1_unplug, mddev, sizeof(*plug));
>> >> >> if (cb)
>> >> >> plug = container_of(cb, struct raid1_plug_cb, cb);
>> >> >> else
>> >> >> plug = NULL;
>> >> >> spin_lock_irqsave(&conf->device_lock, flags);
>> >> >> if (plug) {
>> >> >> bio_list_add(&plug->pending, mbio);
>> >> >> plug->pending_cnt++;
>> >> >> } else {
>> >> >> bio_list_add(&conf->pending_bio_list, mbio);
>> >> >> conf->pending_count++;
>> >> >> }
>> >> >> spin_unlock_irqrestore(&conf->device_lock, flags);
>> >> >>
>> >> >> If the thread blk_check_plugged returns NULL, then you always hand the
>> >> >> WRITE to raid1d. So the only option to avoid handoff to raid1d is for
>> >> >> the caller to plug. Otherwise, all WRITEs are handed off to raid1d and
>> >> >> latency becomes terrible.
>> >> >> So in my case, I use plug/unplug for individual bios only to avoid the
>> >> >> handoff to raid1d.
>> >> >> What am I missing in this analysis?
>> >> >
>> >> > if blk_check_plugged succeeds then it has arranged for raid1_unplug to be
>> >> > called a little later by that same process.
>> >> > So there is nothing to stop you calling raid1_unplug immediately.
>> >> >
>> >> > raid1_unplug essentially does:
>> >> > bitmap_unplug()
>> >> > generic_make_request()
>> >> >
>> >> > so you can very nearly just do that, without any plugging.
>> >> I am sorry, but I did not understand your reply. Maybe I did not
>> >> explain myself, I will try again.
>> >>
>> >> I am not changing raid1.c code. I just want to avoid the handoff to
>> >> raid1d on WRITEs. According to your code, there are only two possible
>> >> flows:
>> >>
>> >> Flow 1 - with plugging
>> >> # caller calls blk_start_plug
>> >> # caller calls submit_bio
>> >> # blk_check_plugged succeeds, and bio is put onto plug->pending list
>> >> # caller calls blk_finish_plug
>> >> # raid1_unplug is called in the same caller's thread, so it does
>> >> bitmap_unplug and generic_make_request
>> >>
>> >> Flow 2 - without plugging
>> >> # caller calls submit_bio
>> >> # blk_check_plugged fails, and bio is put onto conf->pending_bio_list,
>> >> which means it will be submitted by raid1d
>> >>
>> >> My conclusion from that: to avoid the handoff to raid1, caller always
>> >> need to plug, even if it has a single bio to submit. But you said "it
>> >> should be possible to submit individual bios directly from
>> >> make_request without passing them to raid1d and without using
>> >> plugging". So can you explain how it is possible? I prefer not to
>> >> change raid1.c code.
>> >>
>> >> >
>> >> > There is a bit of extra subtlety but I can't really know how relevant that
>> >> > might be to you without actually seeing you code.
>> >> My code (in a different kernel module, not in raid1.c) is simply doing
>> >> submit_bio. I want to wrap this with plug/unplug to avoid the handoff
>> >> to raid1d and improve raid1 latency.
>> >>
>> >
>> > I think I need to see the code you are working with to be able to suggest
>> > anything used.
>> I am working with kernel 3.8.13. But your master branch has the same
>> code with respect to plug/unplug logic.
>>
>> > But if it works with plugging, then just do it that way(?).
>> It works perfectly, and latency is much better. The only doubt is with
>> bitmap_unplug being called from multiple threads now. However, it can
>> happen for anybody that uses plug/unplug on top of MD raid1 (like ext4
>> for example). So question is whether it is safe for MD users to
>> plug/unplug when submitting bios to MD. If not, would you be fixing
>> this?
>
> Didn't I already answer that question?
>
> Date: Tue, 9 Sep 2014 11:45:38 +1000
>
> Hmmm... there could be an issue there. It is possible that some callers of
> bitmap_unplug won't block when they should. bitmap_unplug should probably
> wait unconditionally.
>
> See
> http://git.neil.brown.name/?p=md.git;a=commitdiff;h=339f60d943f848eb516aa4b82b5e187dbbe088dc
>
> (not tested yet).
>
> NeilBrown
>
>
>>
>> Alex.
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: frequent disk activity with mdadm-3.3
From: NeilBrown @ 2014-09-15 0:18 UTC (permalink / raw)
To: Marco Schindler; +Cc: linux-raid
In-Reply-To: <BDDC2624-8578-4720-A526-56EFDFBE26C4@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2252 bytes --]
On Fri, 12 Sep 2014 14:15:35 +0200 Marco Schindler
<marco.schindler@gmail.com> wrote:
> ok, that’s interesting.
> the process id is _not_ mdadm daemon and it looks like the spindown itself is triggering the process.
>
> ps ax | grep mdadm
> 28956 ? Ss 0:00 mdadm --monitor --scan --daemonise --pid-file /var/run/mdadm.pid --syslog
>
> grep sda /var/log/messages
> Sep 12 13:55:04 alina spindown: sda is now inactive.
> Sep 12 13:55:09 alina kernel: mdadm(29737): READ block 3907028992 on sda (8 sectors)
> Sep 12 13:55:17 alina kernel: mdadm(29737): READ block 3907029152 on sda (8 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 0 on sda (8 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 3907029167 on sda (1 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 3907029166 on sda (1 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 0 on sda (1 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 0 on sda (1 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 3907029152 on sda (8 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 0 on sda (8 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
> Sep 12 13:55:26 alina kernel: mdadm(29737): READ block 8 on sda (8 sectors)
> Sep 12 13:56:12 alina spindown: sda is now active.
It would help to get "udevadm monitor" info to correlate with this.
Presumably some uevent is generated when the spindown happens. udev might
respond to this by reading from the device, which defeats the purpose...
>
> here’s the output of blktrace -d /dev/sda during that time.
> https://dl.dropboxusercontent.com/u/3464720/blktrace.tar.bz2
That suggest that something is reading the metadata from the device almost
constantly. Mostly a 'kworker' thread. I don't know what would cause that.
Let's look at the 'udevadm monitor' trace first and see what that shows.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: dmadm question
From: NeilBrown @ 2014-09-15 0:31 UTC (permalink / raw)
To: Luke Odom; +Cc: linux-raid
In-Reply-To: <661E720A-B65C-4C24-B6A4-A4439596DEB9@lukeodom.com>
[-- Attachment #1: Type: text/plain, Size: 3409 bytes --]
On 12 Sep 2014 18:49:54 -0700 Luke Odom <luke@lukeodom.com> wrote:
> I had a raid1 subarray running within an imsm container. One of the drives died so I replaced it. I can get the new drive into the imsm container but I can’t add it to the raid1 array within that container. I’ve read the man page and can’t see to figure it out. Any help would be greatly appreciated. Using mdadm 3.2.5 on debian squeeze.
This should just happen automatically. As soon as you add the device to the
container, mdmon notices and adds it to the raid1.
However it appears not to have happened...
I assume the new drive is exactly the same size as the old drive?
Try removing the new device from md127, run "mdadm --zero" on it, then add it
back again.
Do any messages appear in the kernel logs when you do that?
Is "mdmon md127" running?
NeilBrown
>
>
>
>
> root@ds6790:~# cat /proc/mdstat
> Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
> md126 : active raid1 sda[0]
> 976759808 blocks super external:/md127/0 [2/1] [U_]
>
>
>
>
> md127 : inactive sdb[0](S) sda[1](S)
> 4901 blocks super external:imsm
>
>
>
>
> unused devices: <none>
>
>
>
>
>
>
> root@ds6790:~# mdadm --detail /dev/md126
> /dev/md126:
> Container : /dev/md127, member 0
> Raid Level : raid1
> Array Size : 976759808 (931.51 GiB 1000.20 GB)
> Used Dev Size : 976759940 (931.51 GiB 1000.20 GB)
> Raid Devices : 2
> Total Devices : 1
>
>
>
>
> State : active, degraded
> Active Devices : 1
> Working Devices : 1
> Failed Devices : 0
> Spare Devices : 0
>
>
>
>
>
>
>
>
> UUID : 1be60edf:5c16b945:86434b6b:2714fddb
> Number Major Minor RaidDevice State
> 0 8 0 0 active sync /dev/sda
> 1 0 0 1 removed
>
>
>
>
>
>
> root@ds6790:~# mdadm --examine /dev/md127
> /dev/md127:
> Magic : Intel Raid ISM Cfg Sig.
> Version : 1.1.00
> Orig Family : 6e37aa48
> Family : 6e37aa48
> Generation : 00640a43
> Attributes : All supported
> UUID : ac27ba68:f8a3618d:3810d44f:25031c07
> Checksum : 513ef1f6 correct
> MPB Sectors : 1
> Disks : 2
> RAID Devices : 1
>
>
>
>
> Disk00 Serial : 9XG3RTL0
> State : active
> Id : 00000002
> Usable Size : 1953519880 (931.51 GiB 1000.20 GB)
>
>
>
>
> [Volume0]:
> UUID : 1be60edf:5c16b945:86434b6b:2714fddb
> RAID Level : 1
> Members : 2
> Slots : [U_]
> Failed disk : 1
> This Slot : 0
> Array Size : 1953519616 (931.51 GiB 1000.20 GB)
> Per Dev Size : 1953519880 (931.51 GiB 1000.20 GB)
> Sector Offset : 0
> Num Stripes : 7630936
> Chunk Size : 64 KiB
> Reserved : 0
> Migrate State : idle
> Map State : degraded
> Dirty State : dirty
>
>
>
>
> Disk01 Serial : XG3RWMF
> State : failed
> Id : ffffffff
> Usable Size : 1953519880 (931.51 GiB 1000.20 GB)
>
>
>
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: seems like a deadlock in workqueue when md do a flush
From: Tejun Heo @ 2014-09-15 1:36 UTC (permalink / raw)
To: Vaughan Cao; +Cc: linux-raid, neilb, Lai Jiangshan
In-Reply-To: <5415BF36.9030308@oracle.com>
(cc'ing Lai and quoting whole body)
Hello, Vaughan.
On Mon, Sep 15, 2014 at 12:15:50AM +0800, Vaughan Cao wrote:
> Hi Tejun/Neil,
>
> @ INFO: task kjournald:4931 blocked for more than 120 seconds.
> @ "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> @ kjournald D ffffffff815b9c40 0 4931 2 0x00000000
> @ ffff8811d4b7baa8 0000000000000046 ffff8811d4b7bfd8 0000000000013fc0
> @ ffff8811d4b7a010 0000000000013fc0 0000000000013fc0 0000000000013fc0
> @ ffff8811d4b7bfd8 0000000000013fc0 ffffffff818b2420 ffff8811d8a20140
> @ Call Trace:
> @ [<ffffffff81594729>] schedule+0x29/0x70
> @ [<ffffffff81460a46>] md_flush_request+0x86/0x120
> @ [<ffffffffa004c6eb>] raid0_make_request+0x11b/0x200 [raid0]
> @ [<ffffffff814607cc>] md_make_request+0xdc/0x240
> @ [<ffffffff812669ca>] generic_make_request+0xca/0x100
> @ [<ffffffff81266a79>] submit_bio+0x79/0x160
> @ [<ffffffff811c3fd3>] submit_bh+0x133/0x200
> @ [<ffffffff811c6113>] __sync_dirty_buffer+0x53/0xd0
> @ [<ffffffffa00a38e9>] journal_commit_transaction+0xda9/0x1080 [jbd]
> @ [<ffffffffa00a7c25>] kjournald+0xf5/0x280 [jbd]
> @ [<ffffffff81082e7e>] kthread+0xce/0xe0
> @ [<ffffffff8159e1ac>] ret_from_fork+0x7c/0xb0
>
> I'm facing a strang case which looks like a deadlock in workqueue. Could you
> show me any idea on how to step further?
> The case is we create a md device of type raid0 using two LUNs, mount it as
> ext3 with option barrier=1,data=ordered. The two LUNs are like below:
> @ >> sd 1:2:0:0: [sdb] Write cache: enabled, read cache: disabled, doesn't
> support DPO or FUA
> we use an kernel similar to v3.10.x without per-pool workqueue
> implementation and backported the commit 7b7a866.
Hmmm... there have been a few queue stall fixes. I can't tell whether
they're before or after 3.10 off the top of my head and "a kernel
similar to v3.10.x" isn't a good debug target. How reproducible is
the problem? Can you reproduce it with the mainline kernel?
> The case where many dio_aio_complete_work are waiting for the flush_bio to
> complete, this bio queue an work item and wait, while the work item is
> pending in the worklist but no running workers in this worker_pool and no
> idle worker thread either. I'm guessing it's a bug relative to the missing
> idle workers while there is still pending works on the queue. maybe there is
> no idle worker when wake_up_worker(pool) is called.
Each pool starts with at least one worker and the last idle worker
can't start executing work items until it creates another idle one, so
conditions like that shouldn't happen. If you dump the backtrace of
each worker for pool 15, one of them should be trying to create
another worker.
Looking at the current md code, it looks like md_wq has WQ_MEM_RECLAIM
and is used only for flush_work which presumably doesn't stack. Even
if the pool get blocked on memory allocation, the rescuer should kick
in and ensure forward progress on md_wq. Maybe the pool's management
mechanism is broken and failed to notify the rescuers?
> This is a vmcore from our customer after the block issue is detected. I
> haven't reproduce it locally, but the customer is easy to produce it in
> their environment. If you need more information, please let me know.
>
> commit 7b7a8665edd8db733980389b098530f9e4f630b2
> Author: Christoph Hellwig <hch@infradead.org>
> Date: Wed Sep 4 15:04:39 2013 +0200
>
> direct-io: Implement generic deferred AIO completions
>
> static void dio_bio_end_aio(struct bio *bio, int error)
> {
> ....
> if (dio->result && dio->defer_completion) {
> INIT_WORK(&dio->complete_work,
> dio_aio_complete_work);
> queue_work(dio->inode->i_sb->s_dio_done_wq,
> &dio->complete_work);
> ....
> }
>
>
> Below is some debug from the vmcore.
>
> @ .
> @ void md_flush_request(struct mddev *mddev, struct bio *bio)
> @ {
> @ spin_lock_irq(&mddev->write_lock);
> @ wait_event_lock_irq(mddev->sb_wait,
> @ !mddev->flush_bio,
> @ mddev->write_lock);
> @ mddev->flush_bio = bio;
> @ spin_unlock_irq(&mddev->write_lock);
> @ .
> @ INIT_WORK(&mddev->flush_work, submit_flushes);
> @ queue_work(md_wq, &mddev->flush_work);
> @ }
> @ EXPORT_SYMBOL(md_flush_request);
>
>
> @ Note md0 is a 7T size disk, with ext3 filesystem.
> @ .
> @ /dev/md0 /ora_data ext3 rw,noatime,errors=continue,barrier=1,data=ordered
> 0 0
> @ .
> @ md: bind<sdc1>
> @ md: bind<sdb1>
> @ md: raid0 personality registered for level 0
> @ md/raid0:md0: md_size is 14036237568 sectors.
> @ md: RAID0 configuration for md0 - 1 zone
> @ md: zone0=[sdb1/sdc1]
> @ zone-offset= 0KB, device-offset= 0KB,
> size=7018118784KB
> @ md0: detected capacity change from 0 to 7186553634816
>
>
>
> @ Analyze the vmcore, md0 indeed has a flush_bio pending.
> @ .
> @ struct mddev = 0xffff8811d1441000, flush_bio = 0xffff88102f6536c0,
> @ struct bio {
> @ bi_sector = 0x0,
> @ bi_next = 0x0,
> @ bi_bdev = 0xffff8811d24e5080,
> @ bi_bdev_orig = 0x0,
> @ bi_flags = 0xf000000000000001,
> @ bi_rw = 0x1411, <== (REQ_FLUSH|REQ_NOIDLE|REQ_WRITE|REQ_SYNC)
> @ bi_vcnt = 0x0,
> @ bi_idx = 0x0,
> @ bi_phys_segments = 0x0,
> @ bi_size = 0x0,
> @ bi_seg_front_size = 0x0,
> @ bi_seg_back_size = 0x0,
> @ bi_end_io = 0xffffffff81269d10 <bio_end_flush>,
> @ bi_private = 0xffff88115b9fdcd8,
> @ bi_ioc = 0x0,
> @ bi_css = 0x0,
> @ bi_integrity = 0x0,
> @ bi_max_vecs = 0x0,
> @ bi_cnt = {
> @ counter = 0x2
> @ },
> @ bi_io_vec = 0x0,
> @ bi_pool = 0xffff8811d8696240,
> @ bi_inline_vecs = 0xffff88102f653748
> @ }
> @ This made other bios with REQ_FLUSH set all blocked, e.g. from kjournald.
>
>
> @ kworker/15:3 sent the culprit flush_bio, insert its flush_work into the
> cwq
> @ of cpu15, but the work item is pending and never get run. In the
> meanwhile,
> @ all running workers on this cpu is waiting for mddev->flush_bio to be
> @ cleared, that is, the pending work item(mddev->flush_work) to complete.
> @ Now, the point is why this work item can't get a chance to run.
> @ .
> @ PID: 20757 TASK: ffff881113fea040 CPU: 15 COMMAND: "kworker/15:3"
> @ #0 [ffff88115b9fdac8] __schedule at ffffffff815940a2
> @ #1 [ffff88115b9fdb60] schedule at ffffffff81594729
> @ #2 [ffff88115b9fdb70] schedule_timeout at ffffffff815927c5
> @ #3 [ffff88115b9fdc10] wait_for_common at ffffffff815945ca
> @ #4 [ffff88115b9fdcb0] wait_for_completion at ffffffff815946fd
> @ #5 [ffff88115b9fdcc0] blkdev_issue_flush at ffffffff81269ce0
> @ #6 [ffff88115b9fdd20] ext3_sync_file at ffffffffa00be792 [ext3]
> @ #7 [ffff88115b9fdd70] vfs_fsync_range at ffffffff811c15de
> @ #8 [ffff88115b9fdd80] generic_write_sync at ffffffff811c1641
> @ #9 [ffff88115b9fdd90] dio_complete at ffffffff811cceeb
> @ #10 [ffff88115b9fddd0] dio_aio_complete_work at ffffffff811cd064
> @ #11 [ffff88115b9fdde0] process_one_work at ffffffff8107baf0
> @ #12 [ffff88115b9fde40] worker_thread at ffffffff8107db2e
> @ #13 [ffff88115b9fdec0] kthread at ffffffff81082e7e
> @ #14 [ffff88115b9fdf50] ret_from_fork at ffffffff8159e1ac
> @ .
> @ mddev=0xffff8811d1441000
> @ struct mddev {
> @ ...
> @ flush_bio = 0xffff88102f6536c0,
> @ flush_pending = {
> @ counter = 0x0
> @ },
> @ flush_work = {
> @ data = {
> @ counter = 0xffff88123fdf8005
> <==(WORK_STRUCT_PENDING|WORK_STRUCT_CWQ)
> @ },
> @ entry = {
> @ next = 0xffff8810e74a2130,
> @ prev = 0xffff8810221190f0
> @ },
> @ func = 0xffffffff81463640 <submit_flushes>
> @ },
> @ ...
> @ }
>
> :!cat cwq.0xffff88123fdf8000
> struct cpu_workqueue_struct {
> pool = 0xffff88123fdee910,
> wq = 0xffff8811d80b5480,
> work_color = 0x0,
> flush_color = 0xffffffff,
> nr_in_flight = {0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
> 0x0, 0x0, 0x0},
> nr_active = 0x1,
> max_active = 0x100,
> delayed_works = {
> next = 0xffff88123fdf8060,
> prev = 0xffff88123fdf8060
> }
> }
>
> :!cat worker_pool.x.0xffff88123fdee910
> struct worker_pool {
> gcwq = 0xffff88123fdee700,
> flags = 0x0,
> worklist = {
> next = 0xffff8811324b2870,
> prev = 0xffffffff81904f08 <psinfo_cleanup+8>
> },
> nr_workers = 0x1b,
> nr_idle = 0x0,
> idle_list = {
> next = 0xffff88123fdee938,
> prev = 0xffff88123fdee938
> },
> idle_timer = {
> entry = {
> next = 0x0,
> prev = 0xdead000000200200
> },
> expires = 0x104d7dc00,
> base = 0xffff8811d8428001,
> function = 0xffffffff8107a930 <idle_worker_timeout>,
> data = 0xffff88123fdee910,
> slack = 0xffffffff,
> start_pid = 0xffffffff,
> start_site = 0x0,
> start_comm =
> "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
> },
> mayday_timer = {
> entry = {
> next = 0x0,
> prev = 0xdead000000200200
> },
> expires = 0x104cfa071,
> base = 0xffff8811d8428000,
> function = 0xffffffff8107a830 <gcwq_mayday_timeout>,
> data = 0xffff88123fdee910,
> slack = 0xffffffff,
> start_pid = 0xffffffff,
> start_site = 0x0,
> start_comm =
> "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
> },
> assoc_mutex = {
> count = {
> counter = 0x1
> },
> wait_lock = {
> {
> rlock = {
> raw_lock = {
> {
> head_tail = 0x0,
> tickets = {
> head = 0x0,
> tail = 0x0
> }
> }
> }
> }
> }
> },
> wait_list = {
> next = 0xffff88123fdee9f0,
> prev = 0xffff88123fdee9f0
> },
> owner = 0x0,
> spin_mlock = 0x0
> },
> worker_ida = {
> idr = {
> top = 0xffff8811d8bdf2b0,
> id_free = 0x0,
> layers = 0x1,
> id_free_cnt = 0x0,
> lock = {
> {
> rlock = {
> raw_lock = {
> {
> head_tail = 0x1b001b,
> tickets = {
> head = 0x1b,
> tail = 0x1b
> }
> }
> }
> }
> }
> }
> },
> free_bitmap = 0x0
> }
> }
>
> @ .
> @ crash> ps | awk '{if($0 ~ "kworker" && $3 == "15")print}'
> @ .
> @ 86 2 15 ffff8811d8420240 IN 0.0 0 0
> @ [kworker/15:0H]
> @ 10215 2 15 ffff88117e184140 IN 0.0 0 0
> @ [kworker/15:1H]
> @ 15577 2 15 ffff881137982100 UN 0.0 0 0
> @ [kworker/15:98]
> @ 15597 2 15 ffff8810197d0040 UN 0.0 0 0
> @ [kworker/15:118]
> @ 16212 2 15 ffff881033216040 UN 0.0 0 0
> @ [kworker/15:32]
> @ 16229 2 15 ffff8810224b8380 UN 0.0 0 0
> @ [kworker/15:49]
> @ 17485 2 15 ffff88102e5a0480 UN 0.0 0 0 [kworker/15:0]
> @ 18774 2 15 ffff88115d9ca300 UN 0.0 0 0 [kworker/15:4]
> @ 18777 2 15 ffff88102d854100 UN 0.0 0 0 [kworker/15:7]
> @ 18779 2 15 ffff8810314d01c0 UN 0.0 0 0 [kworker/15:9]
> @ 18780 2 15 ffff88102238a340 UN 0.0 0 0
> @ [kworker/15:10]
> @ 18796 2 15 ffff88102e7c8500 UN 0.0 0 0
> @ [kworker/15:28]
> @ 19958 2 15 ffff881034636040 UN 0.0 0 0 [kworker/15:6]
> @ 19959 2 15 ffff88101e0f0300 UN 0.0 0 0 [kworker/15:8]
> @ 19960 2 15 ffff881017050180 UN 0.0 0 0
> @ [kworker/15:11]
> @ 19961 2 15 ffff88101a28e1c0 UN 0.0 0 0
> @ [kworker/15:12]
> @ 19962 2 15 ffff881016e24200 UN 0.0 0 0
> @ [kworker/15:14]
> @ 20211 2 15 ffff881032210140 UN 0.0 0 0
> @ [kworker/15:15]
> @ 20212 2 15 ffff8810229a42c0 UN 0.0 0 0
> @ [kworker/15:16]
> @ 20755 2 15 ffff881028d38540 UN 0.0 0 0 [kworker/15:1]
> @ 20756 2 15 ffff88102c9e25c0 UN 0.0 0 0 [kworker/15:2]
> @ 20757 2 15 ffff881113fea040 UN 0.0 0 0 [kworker/15:3]
> @ 20758 2 15 ffff8810330fe080 UN 0.0 0 0 [kworker/15:5]
> @ 20759 2 15 ffff8810218220c0 UN 0.0 0 0
> @ [kworker/15:13]
> @ 20760 2 15 ffff88101a1b2100 UN 0.0 0 0
> @ [kworker/15:17]
> @ 20762 2 15 ffff88102cb98180 UN 0.0 0 0
> @ [kworker/15:19]
> @ 20763 2 15 ffff881016c9e1c0 UN 0.0 0 0
> @ [kworker/15:20]
> @ 20764 2 15 ffff8810344f8200 UN 0.0 0 0
> @ [kworker/15:21]
> @ 20765 2 15 ffff8810322aa240 UN 0.0 0 0
> @ [kworker/15:22]
> @ .
> @ ## kworker/15:[01]H are in idle, others running workers, except
> kworker/15:3,
> @ have the same backtrace like this below:
> @ .
> @ PID: 20765 TASK: ffff8810322aa240 CPU: 15 COMMAND: "kworker/15:22"
> @ #0 [ffff88117064ba48] __schedule at ffffffff815940a2
> @ #1 [ffff88117064bae0] schedule at ffffffff81594729
> @ #2 [ffff88117064baf0] md_flush_request at ffffffff81460a46
> @ #3 [ffff88117064bb70] raid0_make_request at ffffffffa00836eb [raid0]
> @ #4 [ffff88117064bbb0] md_make_request at ffffffff814607cc
> @ #5 [ffff88117064bc20] generic_make_request at ffffffff812669ca
> @ #6 [ffff88117064bc50] submit_bio at ffffffff81266a79
> @ #7 [ffff88117064bcc0] blkdev_issue_flush at ffffffff81269cd8
> @ #8 [ffff88117064bd20] ext3_sync_file at ffffffffa00be792 [ext3]
> @ #9 [ffff88117064bd70] vfs_fsync_range at ffffffff811c15de
> @ #10 [ffff88117064bd80] generic_write_sync at ffffffff811c1641
> @ #11 [ffff88117064bd90] dio_complete at ffffffff811cceeb
> @ #12 [ffff88117064bdd0] dio_aio_complete_work at ffffffff811cd064
> @ #13 [ffff88117064bde0] process_one_work at ffffffff8107baf0
> @ #14 [ffff88117064be40] worker_thread at ffffffff8107db2e
> @ #15 [ffff88117064bec0] kthread at ffffffff81082e7e
> @ #16 [ffff88117064bf50] ret_from_fork at ffffffff8159e1ac
>
>
> crash> p pool_nr_running
>
> PER-CPU DATA TYPE:
> atomic_t pool_nr_running[2];
> PER-CPU ADDRESSES:
> [0]: ffff88123fc13f80
> [1]: ffff88123fc33f80
> [2]: ffff88123fc53f80
> [3]: ffff88123fc73f80
> [4]: ffff88123fc93f80
> [5]: ffff88123fcb3f80
> [6]: ffff88123fcd3f80
> [7]: ffff88123fcf3f80
> [8]: ffff88123fd13f80
> [9]: ffff88123fd33f80
> [10]: ffff88123fd53f80
> [11]: ffff88123fd73f80
> [12]: ffff88123fd93f80
> [13]: ffff88123fdb3f80
> [14]: ffff88123fdd3f80
> [15]: ffff88123fdf3f80
> crash> atomic_t ffff88123fdf3f80
> struct atomic_t {
> counter = 0
> }
>
>
> crash> list -o work_struct.entry -s work_struct -x -H ffff88123fdee920
>
> ffff8811324b2868
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff881159922130,
> prev = 0xffff88123fdee920
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff881159922128
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff881135ce1b30,
> prev = 0xffff8811324b2870
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff881135ce1b28
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff881022143130,
> prev = 0xffff881159922130
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff881022143128
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88115b8623b0,
> prev = 0xffff881135ce1b30
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88115b8623a8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff8810261ecdb0,
> prev = 0xffff881022143130
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff8810261ecda8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88104f74ed70,
> prev = 0xffff88115b8623b0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88104f74ed68
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff8810221190f0,
> prev = 0xffff8810261ecdb0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff8810221190e8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff8811d14413d0,
> prev = 0xffff88104f74ed70
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff8811d14413c8
> struct work_struct {
> data = {
> counter = 0xffff88123fdf8005
> },
> entry = {
> next = 0xffff8810e74a2130,
> prev = 0xffff8810221190f0
> },
> func = 0xffffffff81463640 <submit_flushes>
> }
> ffff8810e74a2128
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff881022091870,
> prev = 0xffff8811d14413d0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff881022091868
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff8810e74a2630,
> prev = 0xffff8810e74a2130
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff8810e74a2628
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88103460e370,
> prev = 0xffff881022091870
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88103460e368
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88102a71cb30,
> prev = 0xffff8810e74a2630
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88102a71cb28
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff8810e74c13b0,
> prev = 0xffff88103460e370
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff8810e74c13a8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff881159a5a370,
> prev = 0xffff88102a71cb30
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff881159a5a368
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88102245c3b0,
> prev = 0xffff8810e74c13b0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88102245c3a8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff881113e9c8b0,
> prev = 0xffff881159a5a370
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff881113e9c8a8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff8810222bfd70,
> prev = 0xffff88102245c3b0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff8810222bfd68
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88102fd31af0,
> prev = 0xffff881113e9c8b0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88102fd31ae8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88104f7dcb30,
> prev = 0xffff8810222bfd70
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88104f7dcb28
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88102a59bb30,
> prev = 0xffff88102fd31af0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88102a59bb28
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88104f7dc3b0,
> prev = 0xffff88104f7dcb30
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88104f7dc3a8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88102fd310f0,
> prev = 0xffff88102a59bb30
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88102fd310e8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff8810194878b0,
> prev = 0xffff88104f7dc3b0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff8810194878a8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88102c5aab30,
> prev = 0xffff88102fd310f0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88102c5aab28
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88102a71c630,
> prev = 0xffff8810194878b0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88102a71c628
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88102245c130,
> prev = 0xffff88102c5aab30
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88102245c128
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff8810225c7d70,
> prev = 0xffff88102a71c630
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff8810225c7d68
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff881022143db0,
> prev = 0xffff88102245c130
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff881022143da8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff881022119370,
> prev = 0xffff8810225c7d70
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff881022119368
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff8810225c7870,
> prev = 0xffff881022143db0
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff8810225c7868
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88101a238630,
> prev = 0xffff881022119370
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88101a238628
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88103307ab30,
> prev = 0xffff8810225c7870
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88103307ab28
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88102d9490f0,
> prev = 0xffff88101a238630
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88102d9490e8
> struct work_struct {
> data = {
> counter = 0xffffe8ffffde0905
> },
> entry = {
> next = 0xffff88123fdf4ef0,
> prev = 0xffff88103307ab30
> },
> func = 0xffffffff811cd040 <dio_aio_complete_work>
> }
> ffff88123fdf4ee8
> struct work_struct {
> data = {
> counter = 0xffff88123fdf7305
> },
> entry = {
> next = 0xffff88123fdf0bc8,
> prev = 0xffff88102d9490f0
> },
> func = 0xffffffffa004e9a0
> }
> ffff88123fdf0bc0
> struct work_struct {
> data = {
> counter = 0xffff88123fdf7305
> },
> entry = {
> next = 0xffff88123fdf0c68,
> prev = 0xffff88123fdf4ef0
> },
> func = 0xffffffff8114dc90 <vmstat_update>
> }
> ffff88123fdf0c60
> struct work_struct {
> data = {
> counter = 0xffff88123fdf7305
> },
> entry = {
> next = 0xffffffff81904f08 <psinfo_cleanup+8>,
> prev = 0xffff88123fdf0bc8
> },
> func = 0xffffffff81180200 <cache_reap>
> }
> ffffffff81904f00
> struct work_struct {
> data = {
> counter = 0xffff88123fdf7305
> },
> entry = {
> next = 0xffff88123fdee920,
> prev = 0xffff88123fdf0c68
> },
> func = 0xffffffff8112e040 <psinfo_cleaner>
> }
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH 0/5] Fixes for RAID1 resync
From: NeilBrown @ 2014-09-15 3:30 UTC (permalink / raw)
To: Brassow Jonathan; +Cc: Eivind Sarto, linux-raid, majianpeng
In-Reply-To: <8697EC47-F648-4E66-B37C-4A2DC3030696@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2108 bytes --]
On Thu, 11 Sep 2014 12:12:01 -0500 Brassow Jonathan <jbrassow@redhat.com>
wrote:
>
> On Sep 10, 2014, at 10:45 PM, Brassow Jonathan wrote:
>
> >
> > On Sep 10, 2014, at 1:20 AM, NeilBrown wrote:
> >
> >>
> >> Jon: could you test with these patches on top of what you
> >> have just in case something happens to fix the problem without
> >> me realising it?
> >
> > I'm on it. The test is running. I'll know later tomorrow.
> >
> > brassow
>
> The test is still failing from here. I grabbed 3.17.0-rc4, added the 5 patches, and got the attached backtraces when testing. As I said, the hangs are not exactly the same. This set shows the mdX_raid1 thread in the middle of handling a read failure.
Thanks.
mdX_raid1 is blocked in freeze_array.
That could be caused by conf->nr_pending nor aligning properly with
conf->nr_queued.
Both normal IO and resync IO can be retried with reschedule_retry()
and so be counted into ->nr_queued, but only normal IO gets counted in
->nr_pending.
Previously could could only possibly have on or the other and when handling
a read failure it could only be normal IO. But now that they two types can
interleave, we can have both normal and resync IO requests queued, so we need
to count them both in nr_pending.
So the following patch might help.
How complicated are your test scripts? Could you send them to me so I can
try too?
Thanks,
NeilBrown
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 888dbdfb6986..6a9c73435eb8 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -856,6 +856,7 @@ static void raise_barrier(struct r1conf *conf, sector_t sector_nr)
conf->next_resync + RESYNC_SECTORS),
conf->resync_lock);
+ conf->nr_pending++;
spin_unlock_irq(&conf->resync_lock);
}
@@ -865,6 +866,7 @@ static void lower_barrier(struct r1conf *conf)
BUG_ON(conf->barrier <= 0);
spin_lock_irqsave(&conf->resync_lock, flags);
conf->barrier--;
+ conf->nr_pending--;
spin_unlock_irqrestore(&conf->resync_lock, flags);
wake_up(&conf->wait_barrier);
}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply related
* Re: Status of discard support in MD RAID
From: NeilBrown @ 2014-09-15 3:44 UTC (permalink / raw)
To: Brassow Jonathan; +Cc: linux-raid@vger.kernel.org Raid
In-Reply-To: <1ED0286A-56DA-491D-853A-1C1045449201@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]
On Thu, 11 Sep 2014 18:38:11 -0500 Brassow Jonathan <jbrassow@redhat.com>
wrote:
> Neil (or anyone else),
>
> I know that trim/discard support was added back in 2012 (commit 9db90880). However, I thought there were still issues regarding what happens when various sync operations occur. I'd like to turn on discard support in dm-raid.c (a oneline patch) if things are in order. I can enable any, all or none depending on your recommendation. (I assume RAID1/10 is easier than the parity RAIDs.)
The worst that a sync operation can do is report mismatches and "un-trim"
some (or all) of some devices.
It certainly should never corrupt data.
My perception is that enabling discard support in the filesystem can be good
for some devices and bad for other devices but should always be "safe" even
when not "optimal". I think the same is true for md/raid.
For raid5/6, we only honour discard if the underlying devices report
discarded regions as all-zeros. That make it safe enough I believe.
So I'd suggest: turn it on!
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: Status of discard support in MD RAID
From: NeilBrown @ 2014-09-15 3:46 UTC (permalink / raw)
To: Chris Murphy; +Cc: Brassow Jonathan, linux-raid@vger.kernel.org Raid
In-Reply-To: <26CB8B36-9CD9-4EE0-BFF2-4B183DBDD033@colorremedies.com>
[-- Attachment #1: Type: text/plain, Size: 1763 bytes --]
On Thu, 11 Sep 2014 18:46:04 -0600 Chris Murphy <lists@colorremedies.com>
wrote:
>
> On Sep 11, 2014, at 5:38 PM, Brassow Jonathan <jbrassow@redhat.com> wrote:
>
> > Neil (or anyone else),
> >
> > I know that trim/discard support was added back in 2012 (commit 9db90880). However, I thought there were still issues regarding what happens when various sync operations occur. I'd like to turn on discard support in dm-raid.c (a oneline patch) if things are in order. I can enable any, all or none depending on your recommendation. (I assume RAID1/10 is easier than the parity RAIDs.)
>
> If all the controller and drive support it then it should pass through, but there's the problem whether the SSD supports deterministic trim. If it doesn't, a check check > md/sync_action will report mismatches in md/mismatch_cnt; and a repair will probably corrupt the volume. So you can still use trim with a drive that returns non-deterministic results with raid0/1/10, but you can't rely on the result of md/mismatch_cnt and you can't do repair type scrubs.
>
> For raid5/6, it's a problem to use trim if the drive returns non-deterministically for trimmed blocks. I'd think that in addition to DRAT being supported, it'd need to support DZAT.
md raid5/6 will not use trim unless the underlying device reports
"discard_zeros_data". That is a Linux internal field name. I don't know
exactly that it means in SCSI/SATA/whatever devices.
NeilBrown
>
> smartctl --identify=wb /dev/diskX | grep -i trim
>
>
> Chris Murphy
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: Status of discard support in MD RAID
From: NeilBrown @ 2014-09-15 3:50 UTC (permalink / raw)
To: David Brown
Cc: Chris Murphy, Brassow Jonathan, linux-raid@vger.kernel.org Raid
In-Reply-To: <5412B6D7.1060400@hesbynett.no>
[-- Attachment #1: Type: text/plain, Size: 2496 bytes --]
On Fri, 12 Sep 2014 11:03:19 +0200 David Brown <david.brown@hesbynett.no>
wrote:
> On 12/09/14 02:46, Chris Murphy wrote:
> >
> > On Sep 11, 2014, at 5:38 PM, Brassow Jonathan <jbrassow@redhat.com>
> > wrote:
> >
> >> Neil (or anyone else),
> >>
> >> I know that trim/discard support was added back in 2012 (commit
> >> 9db90880). However, I thought there were still issues regarding
> >> what happens when various sync operations occur. I'd like to turn
> >> on discard support in dm-raid.c (a oneline patch) if things are in
> >> order. I can enable any, all or none depending on your
> >> recommendation. (I assume RAID1/10 is easier than the parity
> >> RAIDs.)
> >
> > If all the controller and drive support it then it should pass
> > through, but there's the problem whether the SSD supports
> > deterministic trim. If it doesn't, a check check > md/sync_action
> > will report mismatches in md/mismatch_cnt; and a repair will probably
> > corrupt the volume. So you can still use trim with a drive that
> > returns non-deterministic results with raid0/1/10, but you can't rely
> > on the result of md/mismatch_cnt and you can't do repair type
> > scrubs.
> >
> > For raid5/6, it's a problem to use trim if the drive returns
> > non-deterministically for trimmed blocks. I'd think that in addition
> > to DRAT being supported, it'd need to support DZAT.
> >
> > smartctl --identify=wb /dev/diskX | grep -i trim
> >
> >
> > Chris Murphy
> >
>
> Would it be possible to change trim/discard commands into write zero
> blocks for some SSDs?
There is a BLKZEROOUT ioctl which writes zeros, using the 'WRITE SAME' SCSI
command if possible.
I suspect it would be quite easy to modify "fstrim" to use BLKZEROOUT
instead of BLKDISCARD.
NeilBrown
> A number of SSD controllers support transparent
> compression, so writing large batches of zeros will result in very small
> writes to the actual flash, and the SSD controller will be able to
> recycle flash used by the overwritten logical blocks just as if they
> were trimmed. Obviously writing zeros will take longer in transfer than
> trim commands, but the result on the disk would be similar and it would
> be guaranteed deterministic.
>
> David
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: Status of discard support in MD RAID
From: NeilBrown @ 2014-09-15 3:56 UTC (permalink / raw)
To: Roman Mamedov
Cc: Chris Murphy, Brassow Jonathan, linux-raid@vger.kernel.org Raid
In-Reply-To: <20140912153915.473bc562@natsu>
[-- Attachment #1: Type: text/plain, Size: 1635 bytes --]
On Fri, 12 Sep 2014 15:39:15 +0600 Roman Mamedov <rm@romanrm.net> wrote:
> On Thu, 11 Sep 2014 18:46:04 -0600
> Chris Murphy <lists@colorremedies.com> wrote:
>
> > If it doesn't, a check check > md/sync_action will report mismatches in
> > md/mismatch_cnt; and a repair will probably corrupt the volume.
>
> At least with RAID1/10, why would it?
>
> > and you can't do repair type scrubs.
>
> If the FS issues TRIM on a certain region, by definition it no longer cares
> about what's stored there (as it's is no longer in use by the FS). So even if
> a repair ends up coping some data from one SSD to another, in effect changing
> the contents of that region, this should not affect anything whatsoever from
> the FS standpoint.
>
> Technically perhaps that still counts as a "corruption", but not of anything
> in the filesystem metadata or user data, just of unused regions. So not as
> scary as it first sounds.
>
> The only case where you'd run into problems with this, is if some apps expect
> to read back zeroes on TRIM'ed regions, e.g. Qemu in the "detect-zeroes=unmap"
> mode. But using that would be dangerous even on a single SSD with
> non-deterministic TRIM, so mdraid changes nothing here.
>
For any block device in Linux you can read the 'queue/discard_zeroes_data'
attribute to see if it is safe to expect zeros from a discarded region.
md sets that correctly.
For raid1/raid10 it is set if all member devices have it set.
For raid5/6, it is never set. This is because we can only discard full
stripes so a non-full-stripe discard will not zero all of the data.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: Speeding up reading with RAID1 and --write-mostly
From: NeilBrown @ 2014-09-15 4:11 UTC (permalink / raw)
To: martin f krafft; +Cc: linux-raid@vger.kernel.org
In-Reply-To: <20140913162301.GB14969@fishbowl.rw.madduck.net>
[-- Attachment #1: Type: text/plain, Size: 795 bytes --]
On Sat, 13 Sep 2014 18:23:01 +0200 martin f krafft <madduck@madduck.net>
wrote:
> also sprach Roberto Spadim <roberto@spadim.com.br> [2014-09-13 13:56 +0200]:
> > Try a bcache or something like it
>
> The problem with a cache is that the data have to be read once from
> the slow disk anyway, whereas I am proposing to keep a shadow copy
> on rotational disk, really, just in case the MMC may need to be
> removed at some point.
>
It is a persistent cache though. So it only needs to be read once.
If the cache SD is the same sizes as the main device then it should never
ever need to read again.
But I suspect you will find that SD cards aren't really fast enough for your
needs. It wouldn't hurt to experiment on just an SD card and see how it
performs.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* grub-probe: "found two disks with the index 3 for RAID md2" after changing superblock 0.9 to 1.0
From: Andy Smith @ 2014-09-15 6:47 UTC (permalink / raw)
To: linux-raid
Hi,
During the process of shrinking the number of devices in a raid-10
array from 6 down to 4¹, I needed to upgrade the superblock from 0.9
to 1.0.
Now, when I run grub-probe on that host it gives me complaints like
this:
error: found two disks with the index 3 for RAID md2.
error: superfluous RAID member (6 found).
(many times over)
Searching around I learn that it may be because grub looks at the
end of the disk and finds an md superblock but cannot tell if it is
for the entire disk or for the final partition on the disk:
http://savannah.gnu.org/bugs/index.php?34250
In my case, I have four disks sda to sdd all of which have three
partitions on them, and md2 is composed of the third (last)
partition.
$ cat /proc/mdstat
Personalities : [raid1] [raid10]
md2 : active raid10 sdd3[0] sdb3[3] sdc3[4] sda3[5]
618726528 blocks super 1.0 64K chunks 2 near-copies [4/4] [UUUU]
md1 : active raid10 sda2[0] sdd2[3] sdc2[2] sdb2[1]
5874688 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU]
md0 : active raid1 sdd1[0] sdc1[3] sdb1[2] sda1[1]
256896 blocks [4/4] [UUUU]
unused devices: <none>
The thing is, that bug report is quite old and is marked closed, and
also states:
"The problem is that 0.9x metadata block doesn't have enough
info to check it. With 1.x we have no such problem."
Of course, it *is* 1.x superblock. Did the poster actually mean to
say that they have no problem with v1.1 and v1.2 (because they are
located at or near the beginning of the device, not at the end)?
The host is Debian wheezy with grub-pc package version
1.99-27+deb7u2 so if that bug is closed due to a fix, I would expect
to have it by now.
There is also a Debian bug bearing some similarity, and that is also
marked fixed upstream and references the above Gnu bug report.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=620390
The host still boots but that may be because md2 is not involved in
booting anyway.
Do other people experience this?
Is it unavoidable with v1.0 superblock?
If so, is there any way to convert to 1.1 or 1.2 without recreating
the array?
Verbose grub-probe output is appended.
Cheers,
Andy
¹ The thread describing that is here:
http://marc.info/?l=linux-raid&m=140881268031291&w=2
$ sudo grub-probe --target=fs -v /boot/grub
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd0.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd1.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd2.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd3.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd4.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd5.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd6.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd7.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd8.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd9.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd10.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd11.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: scanning hd0 for LVM.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: scanning hd1 for LVM.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: scanning hd2 for LVM.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: scanning hd3 for LVM.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: scanning hd4 for LVM.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: scanning hd5 for LVM.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: scanning hd6 for LVM.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: scanning hd7 for LVM.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: scanning hd8 for LVM.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: scanning hd9 for LVM.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: scanning hd10 for LVM.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: scanning hd11 for LVM.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd4.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd5.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd6.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd7.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd8.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd9.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd10.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd11.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd4.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd5.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd6.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd7.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd8.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd9.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd10.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd11.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0,msdos3.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Found array md2 (mdraid09).
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0,msdos2.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0,msdos1.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Found array md0 (mdraid09).
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1,msdos3.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1,msdos2.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1,msdos1.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2,msdos3.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2,msdos2.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2,msdos1.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3,msdos3.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3,msdos2.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3,msdos1.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd4.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd5.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd6.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd7.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd8.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd9.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd10.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: Scanning for mdraid09 RAID devices on disk hd11.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk md0.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0,msdos3.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0,msdos2.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Found array md/1 (mdraid1x).
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0,msdos1.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1,msdos3.
grub-probe: info: the size of hd1 is 625134827.
error: found two disks with the index 3 for RAID md2.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1,msdos2.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1,msdos1.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2,msdos3.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2,msdos2.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2,msdos1.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3,msdos3.
grub-probe: info: the size of hd3 is 625134827.
error: superfluous RAID member (6 found).
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3,msdos2.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3,msdos1.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd4.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd5.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd6.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd7.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd8.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd9.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd10.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: Scanning for mdraid1x RAID devices on disk hd11.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: scanning md/1 for LVM.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning md0 for LVM.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning md2 for LVM.
grub-probe: info: scanning hd0 for LVM.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: scanning hd0,msdos3 for LVM.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd0,msdos2 for LVM.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd0,msdos1 for LVM.
grub-probe: info: the size of hd0 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd1 for LVM.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: scanning hd1,msdos3 for LVM.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd1,msdos2 for LVM.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd1,msdos1 for LVM.
grub-probe: info: the size of hd1 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd2 for LVM.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: scanning hd2,msdos3 for LVM.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd2,msdos2 for LVM.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd2,msdos1 for LVM.
grub-probe: info: the size of hd2 is 625142448.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd3 for LVM.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: scanning hd3,msdos3 for LVM.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: scanning hd3,msdos2 for LVM.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd3,msdos1 for LVM.
grub-probe: info: the size of hd3 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: scanning hd4 for LVM.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd4 is 625134827.
grub-probe: info: scanning hd5 for LVM.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd5 is 976773168.
grub-probe: info: scanning hd6 for LVM.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd6 is 3907029168.
grub-probe: info: scanning hd7 for LVM.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd7 is 5860533168.
grub-probe: info: scanning hd8 for LVM.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd8 is 3907029168.
grub-probe: info: scanning hd9 for LVM.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd9 is 3907029168.
grub-probe: info: scanning hd10 for LVM.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd10 is 976773168.
grub-probe: info: scanning hd11 for LVM.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: no LVM signature found.
grub-probe: info: the size of hd11 is 5860533168.
grub-probe: info: opening mduuid/78cf4169e31908f4e667021c582159fb.
ext2
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: grub-probe: "found two disks with the index 3 for RAID md2" after changing superblock 0.9 to 1.0
From: NeilBrown @ 2014-09-15 7:00 UTC (permalink / raw)
To: Andy Smith; +Cc: linux-raid
In-Reply-To: <20140915064741.GH11855@bitfolk.com>
[-- Attachment #1: Type: text/plain, Size: 23761 bytes --]
On Mon, 15 Sep 2014 06:47:41 +0000 Andy Smith <andy@strugglers.net> wrote:
> Hi,
>
> During the process of shrinking the number of devices in a raid-10
> array from 6 down to 4¹, I needed to upgrade the superblock from 0.9
> to 1.0.
>
> Now, when I run grub-probe on that host it gives me complaints like
> this:
>
> error: found two disks with the index 3 for RAID md2.
> error: superfluous RAID member (6 found).
>
> (many times over)
>
> Searching around I learn that it may be because grub looks at the
> end of the disk and finds an md superblock but cannot tell if it is
> for the entire disk or for the final partition on the disk:
>
> http://savannah.gnu.org/bugs/index.php?34250
>
> In my case, I have four disks sda to sdd all of which have three
> partitions on them, and md2 is composed of the third (last)
> partition.
Is this start of that partition (/sys/block/sda3/start) a multiple of 64K
(i.e. a multiple of 128 sectors)?
If it is, and a if a 0.90 superblock is there, that could be the problem.
>
> $ cat /proc/mdstat
> Personalities : [raid1] [raid10]
> md2 : active raid10 sdd3[0] sdb3[3] sdc3[4] sda3[5]
> 618726528 blocks super 1.0 64K chunks 2 near-copies [4/4] [UUUU]
>
> md1 : active raid10 sda2[0] sdd2[3] sdc2[2] sdb2[1]
> 5874688 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU]
>
> md0 : active raid1 sdd1[0] sdc1[3] sdb1[2] sda1[1]
> 256896 blocks [4/4] [UUUU]
>
> unused devices: <none>
>
> The thing is, that bug report is quite old and is marked closed, and
> also states:
>
> "The problem is that 0.9x metadata block doesn't have enough
> info to check it. With 1.x we have no such problem."
>
> Of course, it *is* 1.x superblock. Did the poster actually mean to
> say that they have no problem with v1.1 and v1.2 (because they are
> located at or near the beginning of the device, not at the end)?
0.90 has the problem, 1.x doesn't.
Maybe there is an old 0.90 superblock confusing things. It lives in a
different location than the others and so there is room for confusion.
mdadm --examine --metadata=0.90 /dev/sda3
which show you the 0.90 metadata if there is any.
mdadm --zero-super --metadata=0.90 /dev/sda3
will remove any 0.90 metadata.
NeilBrown
>
> The host is Debian wheezy with grub-pc package version
> 1.99-27+deb7u2 so if that bug is closed due to a fix, I would expect
> to have it by now.
>
> There is also a Debian bug bearing some similarity, and that is also
> marked fixed upstream and references the above Gnu bug report.
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=620390
>
> The host still boots but that may be because md2 is not involved in
> booting anyway.
>
> Do other people experience this?
>
> Is it unavoidable with v1.0 superblock?
>
> If so, is there any way to convert to 1.1 or 1.2 without recreating
> the array?
>
> Verbose grub-probe output is appended.
>
> Cheers,
> Andy
>
> ¹ The thread describing that is here:
> http://marc.info/?l=linux-raid&m=140881268031291&w=2
>
> $ sudo grub-probe --target=fs -v /boot/grub
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd0.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd1.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd2.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd3.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd4.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd5.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd6.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd7.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd8.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd9.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd10.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd11.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: scanning hd0 for LVM.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: scanning hd1 for LVM.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: scanning hd2 for LVM.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: scanning hd3 for LVM.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: scanning hd4 for LVM.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: scanning hd5 for LVM.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: scanning hd6 for LVM.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: scanning hd7 for LVM.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: scanning hd8 for LVM.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: scanning hd9 for LVM.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: scanning hd10 for LVM.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: scanning hd11 for LVM.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd4.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd5.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd6.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd7.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd8.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd9.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd10.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd11.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd4.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd5.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd6.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd7.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd8.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd9.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd10.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd11.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0,msdos3.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Found array md2 (mdraid09).
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0,msdos2.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0,msdos1.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Found array md0 (mdraid09).
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1,msdos3.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1,msdos2.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1,msdos1.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2,msdos3.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2,msdos2.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd2,msdos1.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3,msdos3.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3,msdos2.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd3,msdos1.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd4.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd5.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd6.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd7.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd8.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd9.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd10.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: Scanning for mdraid09 RAID devices on disk hd11.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk md0.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0,msdos3.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0,msdos2.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Found array md/1 (mdraid1x).
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0,msdos1.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1,msdos3.
> grub-probe: info: the size of hd1 is 625134827.
> error: found two disks with the index 3 for RAID md2.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1,msdos2.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1,msdos1.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2,msdos3.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2,msdos2.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd2,msdos1.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3,msdos3.
> grub-probe: info: the size of hd3 is 625134827.
> error: superfluous RAID member (6 found).
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3,msdos2.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd3,msdos1.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd4.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd5.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd6.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd7.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd8.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd9.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd10.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: Scanning for mdraid1x RAID devices on disk hd11.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: scanning md/1 for LVM.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning md0 for LVM.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning md2 for LVM.
> grub-probe: info: scanning hd0 for LVM.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: scanning hd0,msdos3 for LVM.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd0,msdos2 for LVM.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd0,msdos1 for LVM.
> grub-probe: info: the size of hd0 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd1 for LVM.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: scanning hd1,msdos3 for LVM.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd1,msdos2 for LVM.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd1,msdos1 for LVM.
> grub-probe: info: the size of hd1 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd2 for LVM.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: scanning hd2,msdos3 for LVM.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd2,msdos2 for LVM.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd2,msdos1 for LVM.
> grub-probe: info: the size of hd2 is 625142448.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd3 for LVM.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: scanning hd3,msdos3 for LVM.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: scanning hd3,msdos2 for LVM.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd3,msdos1 for LVM.
> grub-probe: info: the size of hd3 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: scanning hd4 for LVM.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd4 is 625134827.
> grub-probe: info: scanning hd5 for LVM.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd5 is 976773168.
> grub-probe: info: scanning hd6 for LVM.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd6 is 3907029168.
> grub-probe: info: scanning hd7 for LVM.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd7 is 5860533168.
> grub-probe: info: scanning hd8 for LVM.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd8 is 3907029168.
> grub-probe: info: scanning hd9 for LVM.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd9 is 3907029168.
> grub-probe: info: scanning hd10 for LVM.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd10 is 976773168.
> grub-probe: info: scanning hd11 for LVM.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: no LVM signature found.
> grub-probe: info: the size of hd11 is 5860533168.
> grub-probe: info: opening mduuid/78cf4169e31908f4e667021c582159fb.
> ext2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* [PATCH v3 00/12] LLVMLinux: Patches to enable the kernel to be compiled with clang/LLVM
From: behanw @ 2014-09-15 7:30 UTC (permalink / raw)
To: agk, clm, davem, dm-devel, fabf, herbert, jbacik, snitzer,
tadeusz.struk
Cc: akpm, bruce.w.allan, d.kasatkin, james.l.morris, john.griffin,
linux-btrfs, linux-crypto, linux-ima-devel, linux-ima-user,
linux-kernel, linux-raid, linux-security-module, neilb, qat-linux,
serge, thomas.lendacky, zohar, torvalds, Behan Webster
From: Behan Webster <behanw@converseincode.com>
These patches replace the use of Variable Length Arrays In Structs (VLAIS) in
crypto related code with C99 compliant equivalent code. A SHASH_DESC_ON_STACK()
macro is added to hash.h which is then used to replace the use of VLAIS in all
the other patches. The minimum size and alignment are maintained by the new code.
The new code can be compiled with both gcc and clang.
The LLVMLinux project aims to fully build the Linux kernel using both gcc and
clang (the C front end for the LLVM compiler infrastructure project).
Behan Webster (6):
crypto: LLVMLinux: Add macro to remove use of VLAIS in crypto code
crypto: LLVMLinux: Remove VLAIS from crypto/mv_cesa.c
crypto: LLVMLinux: Remove VLAIS from crypto/n2_core.c
crypto: LLVMLinux: Remove VLAIS from crypto/omap_sham.c
crypto: LLVMLinux: Remove VLAIS from crypto/.../qat_algs.c
security, crypto: LLVMLinux: Remove VLAIS from ima_crypto.c
Jan-Simon Möller (5):
crypto: LLVMLinux: Remove VLAIS from crypto/ccp/ccp-crypto-sha.c
crypto, dm: LLVMLinux: Remove VLAIS usage from dm-crypt
crypto: LLVMLinux: Remove VLAIS usage from crypto/hmac.c
crypto: LLVMLinux: Remove VLAIS usage from libcrc32c.c
crypto: LLVMLinux: Remove VLAIS usage from crypto/testmgr.c
Vinícius Tinti (1):
btrfs: LLVMLinux: Remove VLAIS
crypto/hmac.c | 25 +++++++---------
crypto/testmgr.c | 14 ++++-----
drivers/crypto/ccp/ccp-crypto-sha.c | 13 ++++----
drivers/crypto/mv_cesa.c | 41 +++++++++++--------------
drivers/crypto/n2_core.c | 11 +++----
drivers/crypto/omap-sham.c | 28 +++++++-----------
drivers/crypto/qat/qat_common/qat_algs.c | 31 +++++++++----------
drivers/md/dm-crypt.c | 34 +++++++++------------
fs/btrfs/hash.c | 16 +++++-----
include/crypto/hash.h | 5 ++++
lib/libcrc32c.c | 16 +++++-----
security/integrity/ima/ima_crypto.c | 51 ++++++++++++++------------------
12 files changed, 126 insertions(+), 159 deletions(-)
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH v3 01/12] crypto: LLVMLinux: Add macro to remove use of VLAIS in crypto code
From: behanw @ 2014-09-15 7:30 UTC (permalink / raw)
To: agk, clm, davem, dm-devel, fabf, herbert, jbacik, snitzer,
tadeusz.struk
Cc: thomas.lendacky, linux-ima-user, qat-linux, d.kasatkin,
bruce.w.allan, linux-kernel, john.griffin, linux-raid,
linux-security-module, Behan Webster, linux-crypto,
james.l.morris, torvalds, linux-ima-devel, akpm, zohar,
linux-btrfs, serge
In-Reply-To: <1410766234-1634-1-git-send-email-behanw@converseincode.com>
From: Behan Webster <behanw@converseincode.com>
Add a macro which replaces the use of a Variable Length Array In Struct (VLAIS)
with a C99 compliant equivalent. This macro instead allocates the appropriate
amount of memory using an char array.
The new code can be compiled with both gcc and clang.
struct shash_desc contains a flexible array member member ctx declared with
CRYPTO_MINALIGN_ATTR, so sizeof(struct shash_desc) aligns the beginning
of the array declared after struct shash_desc with long long.
No trailing padding is required because it is not a struct type that can
be used in an array.
The CRYPTO_MINALIGN_ATTR is required so that desc is aligned with long long
as would be the case for a struct containing a member with
CRYPTO_MINALIGN_ATTR.
Signed-off-by: Behan Webster <behanw@converseincode.com>
---
include/crypto/hash.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index a391955..541125b 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -58,6 +58,11 @@ struct shash_desc {
void *__ctx[] CRYPTO_MINALIGN_ATTR;
};
+#define SHASH_DESC_ON_STACK(shash, tfm) \
+ char __desc[sizeof(struct shash_desc) + \
+ crypto_shash_descsize(tfm)] CRYPTO_MINALIGN_ATTR; \
+ struct shash_desc *shash = (struct shash_desc *)__desc
+
struct shash_alg {
int (*init)(struct shash_desc *desc);
int (*update)(struct shash_desc *desc, const u8 *data,
--
1.9.1
^ permalink raw reply related
* [PATCH v3 02/12] btrfs: LLVMLinux: Remove VLAIS
From: behanw @ 2014-09-15 7:30 UTC (permalink / raw)
To: agk, clm, davem, dm-devel, fabf, herbert, jbacik, snitzer,
tadeusz.struk
Cc: thomas.lendacky, linux-ima-user, qat-linux, d.kasatkin,
bruce.w.allan, linux-kernel, john.griffin, linux-raid,
linux-security-module, Vinícius Tinti, linux-crypto,
james.l.morris, torvalds, linux-ima-devel, Behan Webster, akpm,
zohar, linux-btrfs, serge
In-Reply-To: <1410766234-1634-1-git-send-email-behanw@converseincode.com>
From: Vinícius Tinti <viniciustinti@gmail.com>
Replaced the use of a Variable Length Array In Struct (VLAIS) with a C99
compliant equivalent. This is the original VLAIS struct.
struct {
struct shash_desc shash;
char ctx[crypto_shash_descsize(tfm)];
} desc;
This patch instead allocates the appropriate amount of memory using a
char array using the SHASH_DESC_ON_STACK macro.
The new code can be compiled with both gcc and clang.
Signed-off-by: Vinícius Tinti <viniciustinti@gmail.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
---
fs/btrfs/hash.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/fs/btrfs/hash.c b/fs/btrfs/hash.c
index 85889aa..4bf4d3a 100644
--- a/fs/btrfs/hash.c
+++ b/fs/btrfs/hash.c
@@ -33,18 +33,16 @@ void btrfs_hash_exit(void)
u32 btrfs_crc32c(u32 crc, const void *address, unsigned int length)
{
- struct {
- struct shash_desc shash;
- char ctx[crypto_shash_descsize(tfm)];
- } desc;
+ SHASH_DESC_ON_STACK(shash, tfm);
+ u32 *ctx = (u32 *)shash_desc_ctx(shash);
int err;
- desc.shash.tfm = tfm;
- desc.shash.flags = 0;
- *(u32 *)desc.ctx = crc;
+ shash->tfm = tfm;
+ shash->flags = 0;
+ *ctx = crc;
- err = crypto_shash_update(&desc.shash, address, length);
+ err = crypto_shash_update(shash, address, length);
BUG_ON(err);
- return *(u32 *)desc.ctx;
+ return *ctx;
}
--
1.9.1
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox