Mounting with discard option

Moderators: mdrjr, odroid

Mounting with discard option

Unread postby rockla » Wed Jan 21, 2015 2:43 am

Ext4 partition seems to be coming up with below discard option ? Any clues ?

Code: Select all
  8.184601@3] EXT4-fs (sda2): mounting with "discard" option, but the device does not support discard
  8.184609@3] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
rockla
 
Posts: 186
Joined: Sat Dec 27, 2014 6:50 pm
languages_spoken: english
ODROIDs: C1,C2

Re: Mounting with discard option

Unread postby mdrjr » Wed Jan 21, 2015 3:55 am

kernel handles discard by itself. You don't have to use it as a mount option.

[ 19.423904@0] force enable DISCARD here for ext4 fs
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: Mounting with discard option

Unread postby Matt » Wed Jan 21, 2015 3:16 pm

I had been wondering after seeing a few threads mentioning the desire to use the discard option if the eMMC modules even support it. I know that the purpose is to allow usage of the TRIM command, which allows SSD garbage collection to better wear-level the flash memory, lengthening the life of the chips. Generally, however, the TRIM command is interpreted by the SSD's controller chip, which is in charge of keeping track of where pages of memory are mapped, and how data is distributed to those pages to get the best performance from the drive. Since an eMMC module is a single flash chip, it doesn't need a controller to orchestrate the distribution of data amongst several different flash chips. I would assume that there is some form of controller circuitry on the chip itself, much like there is on the better flash memory cards (SD, Memorystick, CF, etc), but I sort of doubt that they support the TRIM command.

That said, should we assume that the TRIM command is built into the eMMC driver in the Linux kernel? Is that why it is enabled by force?

P.S. - Sorry for hijacking the thread, but I thought that it is somewhat on-topic.
ODROID Boards: U2, X2, XU+E rev.2
Accessories: VU, Smart Power, 13" LCD Kit (for the X2)
User avatar
Matt
 
Posts: 576
Joined: Tue Feb 26, 2013 4:57 pm
Location: Charlottesville, VA, USA
languages_spoken: English
ODROIDs: X2, U2, XU+E rev.2, Smart Power

Re: Mounting with discard option

Unread postby rockla » Wed Jan 21, 2015 11:04 pm

mdrjr wrote:kernel handles discard by itself. You don't have to use it as a mount option.

[ 19.423904@0] force enable DISCARD here for ext4 fs

I'm not using discard just wondering why is kernel taking it then ?
rockla
 
Posts: 186
Joined: Sat Dec 27, 2014 6:50 pm
languages_spoken: english
ODROIDs: C1,C2

Re: Mounting with discard option

Unread postby tobetter » Wed Jan 21, 2015 11:26 pm

rockla wrote:
mdrjr wrote:kernel handles discard by itself. You don't have to use it as a mount option.

[ 19.423904@0] force enable DISCARD here for ext4 fs

I'm not using discard just wondering why is kernel taking it then ?

Ok, I found there is a commit by AMLogic and it says 'DISCARD' is enabled for NAND flash. It is not in genuine Linux kernel, should be recovered.
tobetter
 
Posts: 2085
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Mounting with discard option

Unread postby matrix2311 » Mon Oct 09, 2017 6:10 am

Hi,

is it possible to deactivate the DISCARD-Kernel-Routines for HDDs (or completly)? At the moment the kernel-discard-routine is mounting my autofs unmounted drives every 15 minutes :( This is not optimal and seems to be an odroid kernel issue only!?

Regards,
Oliver.
matrix2311
 
Posts: 9
Joined: Sun Feb 08, 2015 9:38 pm
languages_spoken: english, german
ODROIDs: C1

Re: Mounting with discard option

Unread postby tobetter » Mon Oct 09, 2017 3:09 pm

matrix2311 wrote:Hi,

is it possible to deactivate the DISCARD-Kernel-Routines for HDDs (or completly)? At the moment the kernel-discard-routine is mounting my autofs unmounted drives every 15 minutes :( This is not optimal and seems to be an odroid kernel issue only!?

Regards,
Oliver.

Here is the code which activates DISCARD option by default in Linux kernel.
https://github.com/hardkernel/linux/blo ... er.c#L3445

If you can build Linux kernel by yourself, you can uncomment the if statement to check DISCARD option. I've attached the patch for the same, please let me know whether it works for you. :)
Attachments
0001-ODROID-C1-ext4-deactivate-default-DISCARD-option.patch.txt
(1.36 KiB) Downloaded 13 times
tobetter
 
Posts: 2085
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Mounting with discard option

Unread postby matrix2311 » Mon Oct 09, 2017 4:14 pm

Hi,

thank you for your support. So i compiled the kernel with your patch and the discard-mount disappeared. But the via AUTOFS unmounted volume /dev/sda1 is still mounted back via the kernel every 15 minutes?

Code: Select all
...
Oct  9 19:00:07 odroid kernel: [ 1582.517325@3] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
...


This behaviour is only on the ODROID C1 :? . No other x86 or Rasberry mounts a via AUTOFS unmounted volume on itself. I'm trying to check if the USB/SATA-interface is doing something wrong! I will report if i find something.

Regards,
Oliver.
matrix2311
 
Posts: 9
Joined: Sun Feb 08, 2015 9:38 pm
languages_spoken: english, german
ODROIDs: C1

Re: Mounting with discard option

Unread postby matrix2311 » Wed Oct 11, 2017 2:56 am

So,

last report here in this thread. I tried everything but the odroid kernel is mounting back the autofs-volumen on his own every 10-15 minutes. I didn't see this behaviour on other installations (pi or x86). I seems to be a kernel-problem.

The problem is, that i cannot use a hdd connected to the odroid in 24x7-mode with autospindown (to extend the hdds lifetime), because the kernel is spinning up the drive very often.

I'm trying to find another solution.

Regards,
Oliver.
matrix2311
 
Posts: 9
Joined: Sun Feb 08, 2015 9:38 pm
languages_spoken: english, german
ODROIDs: C1

Re: Mounting with discard option

Unread postby tobetter » Wed Oct 11, 2017 11:20 am

matrix2311 wrote:So,

last report here in this thread. I tried everything but the odroid kernel is mounting back the autofs-volumen on his own every 10-15 minutes. I didn't see this behaviour on other installations (pi or x86). I seems to be a kernel-problem.

The problem is, that i cannot use a hdd connected to the odroid in 24x7-mode with autospindown (to extend the hdds lifetime), because the kernel is spinning up the drive very often.

I'm trying to find another solution.

Regards,
Oliver.

I am not very familiar with AUTOFS, but my understanding of AUTOFS is that it mounts a partition to file system on demand. So I am suspecting there is a process or a daemon which access your HDD periodically every 10-15 minutes. Not sure, just guessing it. :?
tobetter
 
Posts: 2085
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Mounting with discard option

Unread postby mad_ady » Wed Oct 11, 2017 2:43 pm

@tobetter is right. Something tries to access the mountpoint. I think you can find out what files are being accessed by using inotify to log all accesses to that mountpoint. Haven't done it, but would be nice to see how it can be done.
User avatar
mad_ady
 
Posts: 2886
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Mounting with discard option

Unread postby ard » Mon Oct 23, 2017 5:44 pm

Matt wrote:Since an eMMC module is a single flash chip, it doesn't need a controller to orchestrate the distribution of data amongst several different flash chips. I would assume that there is some form of controller circuitry on the chip itself, much like there is on the better flash memory cards (SD, Memorystick, CF, etc), but I sort of doubt that they support the TRIM command.

The controller on an eMMC usuall is a generic arm cpu at a relatively high clock frequency.
It's tasks are the same as on SSD, except it has more tasks: it also has to provide for a boot safe partition (It might go to slc mode voor boot0 and boot1 instead of mlc for the user data partitition), and it has replay attack protected key value store (rpmb).
The eMMC also has to be much better than an SSD, since an eMMC is usually not replacable. It get's soldered onto the board and should last a product "lifetime" (which might be anything from 2 to 20 years).
So yeah, the eMMC is pretty intelligent. It does wear leveling and it does want to know which regions can be discarded.
Notice that it doesn't matter how many flash chips you have, wear leveling is needed, *always*. Per spec eMMC does it for you.
If you have plain flash chips (either nand or nor), you would be using ubifs or jffs2, as these filesystems handle wearleveling on nand level.
The next level "eMMC" flash chip are called universal flash, and they actually have a sata interface.
ard
 
Posts: 67
Joined: Tue Jul 09, 2013 2:12 am
languages_spoken: english, dutch, german
ODROIDs: ODROID-U2


Return to Issues

Who is online

Users browsing this forum: No registered users and 3 guests