linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question re: trim in btrfs
@ 2016-10-18 17:42 Tim Walberg
  2016-10-18 19:06 ` Tim Walberg
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Walberg @ 2016-10-18 17:42 UTC (permalink / raw)
  To: linux-btrfs

Unless I'm misinterpreting something it appears that maybe btrfs doesn't pass
fstrim commands down to the underlying drives when being used in a RAID-1 config.

I have this output from a small script I wrote to run at boot time (and also via
cron.weekly), rather than using continous trim in the boot options:

# cat /var/log/trim.log
Thu Oct 13 07:40:07 CDT 2016
/boot: 454 MiB (476062720 bytes) trimmed

Thu Oct 13 07:40:08 CDT 2016
/: 8.9 GiB (9585152000 bytes) trimmed

Thu Oct 13 07:40:22 CDT 2016
/btrfs/0: 0 B (0 bytes) trimmed

/boot and / are mdraid RAID 1 on partitions 1 and 3 of two Samsung 850 Pro SSDs.
/btrfs/0 is a btrfs-raid RAID 1 of partition 4 on the same two drives. The btrfs
case does not seem to accomplish anything. By comparison, I have the same drive
in my laptop, but just a single one, and the non-btrfs-raid-1 file system on one
of its partitions does run fstrim successfully.

This is quite possibly a known limitation, but I didn't find anything about it
through some quick searching. Maybe I didn't dive deep enough...

-- 
twalberg@gmail.com, twalberg@comcast.net

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

* Re: question re: trim in btrfs
  2016-10-18 17:42 question re: trim in btrfs Tim Walberg
@ 2016-10-18 19:06 ` Tim Walberg
  2016-10-18 21:31   ` Jeff Mahoney
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Walberg @ 2016-10-18 19:06 UTC (permalink / raw)
  To: linux-btrfs

Forgot to mention - this was on a rather crusty 4.2.6 kernel. Just upgraded to 4.8.1
and the issue appears to have been resolved...

On 10/18/2016 12:42 -0500, Walberg, Tim wrote:
>>	Unless I'm misinterpreting something it appears that maybe btrfs doesn't pass
>>	fstrim commands down to the underlying drives when being used in a RAID-1 config.
>>	
>>	I have this output from a small script I wrote to run at boot time (and also via
>>	cron.weekly), rather than using continous trim in the boot options:
>>	
>>	# cat /var/log/trim.log
>>	Thu Oct 13 07:40:07 CDT 2016
>>	/boot: 454 MiB (476062720 bytes) trimmed
>>	
>>	Thu Oct 13 07:40:08 CDT 2016
>>	/: 8.9 GiB (9585152000 bytes) trimmed
>>	
>>	Thu Oct 13 07:40:22 CDT 2016
>>	/btrfs/0: 0 B (0 bytes) trimmed
>>	
>>	/boot and / are mdraid RAID 1 on partitions 1 and 3 of two Samsung 850 Pro SSDs.
>>	/btrfs/0 is a btrfs-raid RAID 1 of partition 4 on the same two drives. The btrfs
>>	case does not seem to accomplish anything. By comparison, I have the same drive
>>	in my laptop, but just a single one, and the non-btrfs-raid-1 file system on one
>>	of its partitions does run fstrim successfully.
>>	
>>	This is quite possibly a known limitation, but I didn't find anything about it
>>	through some quick searching. Maybe I didn't dive deep enough...
>>	
>>	-- 
>>	twalberg@gmail.com, twalberg@comcast.net
>>	--
>>	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
End of included message



-- 
twalberg@gmail.com, twalberg@comcast.net

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

* Re: question re: trim in btrfs
  2016-10-18 19:06 ` Tim Walberg
@ 2016-10-18 21:31   ` Jeff Mahoney
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Mahoney @ 2016-10-18 21:31 UTC (permalink / raw)
  To: Tim Walberg, linux-btrfs


[-- Attachment #1.1: Type: text/plain, Size: 2175 bytes --]

On 10/18/16 3:06 PM, Tim Walberg wrote:
> Forgot to mention - this was on a rather crusty 4.2.6 kernel. Just upgraded to 4.8.1
> and the issue appears to have been resolved...

Thanks for following up.  This issue was actually fixed in v4.3.  There
were a bunch of fixes for discard ranging from correct(ish[1]) reporting
of bytes discarded, discarding ranges in freed block groups, and missing
discards when using -odiscard.

-Jeff

[1] We report the range for which we issue discards.  We don't track if
a particular range has been previously discarded.

> On 10/18/2016 12:42 -0500, Walberg, Tim wrote:
>>> 	Unless I'm misinterpreting something it appears that maybe btrfs doesn't pass
>>> 	fstrim commands down to the underlying drives when being used in a RAID-1 config.
>>> 	
>>> 	I have this output from a small script I wrote to run at boot time (and also via
>>> 	cron.weekly), rather than using continous trim in the boot options:
>>> 	
>>> 	# cat /var/log/trim.log
>>> 	Thu Oct 13 07:40:07 CDT 2016
>>> 	/boot: 454 MiB (476062720 bytes) trimmed
>>> 	
>>> 	Thu Oct 13 07:40:08 CDT 2016
>>> 	/: 8.9 GiB (9585152000 bytes) trimmed
>>> 	
>>> 	Thu Oct 13 07:40:22 CDT 2016
>>> 	/btrfs/0: 0 B (0 bytes) trimmed
>>> 	
>>> 	/boot and / are mdraid RAID 1 on partitions 1 and 3 of two Samsung 850 Pro SSDs.
>>> 	/btrfs/0 is a btrfs-raid RAID 1 of partition 4 on the same two drives. The btrfs
>>> 	case does not seem to accomplish anything. By comparison, I have the same drive
>>> 	in my laptop, but just a single one, and the non-btrfs-raid-1 file system on one
>>> 	of its partitions does run fstrim successfully.
>>> 	
>>> 	This is quite possibly a known limitation, but I didn't find anything about it
>>> 	through some quick searching. Maybe I didn't dive deep enough...
>>> 	
>>> 	-- 
>>> 	twalberg@gmail.com, twalberg@comcast.net
>>> 	--
>>> 	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
> End of included message
> 
> 
> 


-- 
Jeff Mahoney
SUSE Labs


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

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

end of thread, other threads:[~2016-10-18 21:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18 17:42 question re: trim in btrfs Tim Walberg
2016-10-18 19:06 ` Tim Walberg
2016-10-18 21:31   ` Jeff Mahoney

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