Skip to contentSkip to conversation

TAKE 981498 - use KM_MAYFAIL in xfs_mountfs

DISCUSSION Lachlan McIlroy 4 participants 8 messages Aug 6, 2008 – Aug 8, 2008

lore
Share & tools
lore
#0 lore raw

use KM_MAYFAIL in xfs_mountfs

Use KM_MAYFAIL for the m_perag allocation, we can deal with the error easily and blocking forever during mount is not a good idea either.

Date:  Wed Aug  6 15:40:44 AEST 2008
Workarea:  redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm

Inspected by:
hch
lachlan
Author: lachlan

The following file(s) were checked into:
longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb

Modid: xfs-linux-melb:xfs-kern:31837a
fs/xfs/xfs_mount.c - 1.445 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.445&r2=text&tr2=1.444&f=h
- use KM_MAYFAIL in xfs_mountfs

#1 lore raw

Why are we going to block for ever? Mounting a file-system requires in-core log space buffers, reading of other buffers which needs allocation of memory greater than per ag structures.

I am trying to understand why xfs_perag_t? Mount/Unmount are not frequent activities, it is better for them to succeed if operating system can allocate memory and take them forward.

-Saradhi.

Quoted 15 lines · Lachlan McIlroy

use KM_MAYFAIL in xfs_mountfs

Use KM_MAYFAIL for the m_perag allocation, we can deal with the error easily and blocking forever during mount is not a good idea either.

Date:  Wed Aug  6 15:40:44 AEST 2008
Workarea:  redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-mm

Inspected by:
hch
lachlan
Author: lachlan

Quoted 6 lines

The following file(s) were checked into:
longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb

Modid: xfs-linux-melb:xfs-kern:31837a
fs/xfs/xfs_mount.c - 1.445 - changed

http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_mount.c.diff?r1=text&tr1=1.445&r2=text&tr2=1.444&f=h

Quoted 8 lines

http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.445&r2=text&tr2=1.444&f=h
- use KM_MAYFAIL in xfs_mountfs

[[HTML alternate version deleted]]

#2 lore raw
Quoted 9 lines · Bhagi rathi

Why are we going to block for ever? Mounting a file-system requires in-core log space buffers, reading of other buffers which needs allocation of memory greater than per ag structures.

I am trying to understand why xfs_perag_t? Mount/Unmount are not frequent activities, it is better for them to succeed if operating system can allocate memory and take them forward.

But that's the big if, right?

If the system is so starved that you can't get this memory to even start the mount process, I'm sure it's better to fail the mount with -ENOMEM than to add to the current system memory stress.

In general KM_MAYFAIL sounds like a good plan when you can handle the failure gracefully, I think.

-Eric

#3 lore raw
Quoted 5 lines · Eric Sandeen
Quoted 4 lines · Bhagi rathi

Why are we going to block for ever? Mounting a file-system requires in-core log space buffers, reading of other buffers which needs allocation of memory greater than per ag structures.

.....

Quoted 2 lines

In general KM_MAYFAIL sounds like a good plan when you can handle the failure gracefully, I think.

Yes, and that is the long term plan - to remove all KM_SLEEP allocations from XFS and allow them to fail gracefully. There's lots of work needed before we get there, though. e.g. right now we cannot survive an ENOMEM error in a transaction....

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#4 lore raw
Quoted 6 lines · Dave Chinner
Quoted 5 lines · Eric Sandeen
Quoted 4 lines · Bhagi rathi

Why are we going to block for ever? Mounting a file-system requires in-core log space buffers, reading of other buffers which needs allocation of memory greater than per ag structures.

Quoted 8 lines

.....

Quoted 2 lines

In general KM_MAYFAIL sounds like a good plan when you can handle the failure gracefully, I think.

Yes, and that is the long term plan - to remove all KM_SLEEP allocations from XFS and allow them to fail gracefully. There's lots of work needed before we get there, though. e.g. right now we cannot survive an ENOMEM error in a transaction....

I am not sure that we are solving right problem. Isn't the above is
fall-out
of XFS needing memory to clean dirty memory? That is of good priority to engineer than this handling of ENOMEM in transactions.

Cheers,
Bhagi.

Quoted 9 lines

Cheers,

Dave.
--
Dave Chinner
[email protected]

[[HTML alternate version deleted]]

#5 lore raw
Quoted 18 lines · Bhagi rathi
Quoted 6 lines · Dave Chinner
Quoted 5 lines · Eric Sandeen
Quoted 4 lines · Bhagi rathi

Why are we going to block for ever? Mounting a file-system requires in-core log space buffers, reading of other buffers which needs allocation of memory greater than per ag structures.

Quoted 8 lines

.....

Quoted 2 lines

In general KM_MAYFAIL sounds like a good plan when you can handle the failure gracefully, I think.

Yes, and that is the long term plan - to remove all KM_SLEEP allocations from XFS and allow them to fail gracefully. There's lots of work needed before we get there, though. e.g. right now we cannot survive an ENOMEM error in a transaction....

Quoted 3 lines

I am not sure that we are solving right problem. Isn't the above is
fall-out
of XFS needing memory to clean dirty memory?

We can't avoid that. It is inherent in the design of XFS. And the amount of memory is not easily bounded so existing solutions like wrapping slabs in mempools don't work, either.

Quoted 2 lines

That is of good priority
to engineer than this handling of ENOMEM in transactions.

That's just one example of an extremely non-trivial piece of work that needs to be done to allow all memory allocations to fail. This work will be done for other reasons (like transaction rollback to prevent shutdowns on errors inside a dirty transaction), not specifically to allow memory allocations to fail.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#6 lore raw
Quoted 20 lines · Dave Chinner
Quoted 1 line · Bhagi rathi

On Thu, Aug 7, 2008 at 1:52 AM, Dave Chinner <[email protected]>

Quoted 17 lines · wrote:
Quoted 15 lines · Eric Sandeen
Quoted 5 lines
Quoted 4 lines · Bhagi rathi

Why are we going to block for ever? Mounting a file-system requires in-core log space buffers, reading of other buffers which needs allocation of memory greater than per ag structures.

.....

Quoted 2 lines

In general KM_MAYFAIL sounds like a good plan when you can handle the failure gracefully, I think.

Yes, and that is the long term plan - to remove all KM_SLEEP allocations from XFS and allow them to fail gracefully. There's lots of work needed before we get there, though. e.g. right now we cannot survive an ENOMEM error in a transaction....

Quoted 7 lines
Quoted 3 lines

I am not sure that we are solving right problem. Isn't the above is
fall-out
of XFS needing memory to clean dirty memory?

We can't avoid that. It is inherent in the design of XFS. And the amount of memory is not easily bounded so existing solutions like wrapping slabs in mempools don't work, either.

Interesting. The only dirty items are xfs inodes, quota's and meta-data buffers. We can fixed number of these items and ensure pushing of data one after the other in the case of crunch.

What are the objects of dirty data where the memory is not bounded?

Quoted 10 lines
Quoted 3 lines

That is of good priority
to engineer than this handling of ENOMEM in transactions.

That's just one example of an extremely non-trivial piece of work that needs to be done to allow all memory allocations to fail. This work will be done for other reasons (like transaction rollback to prevent shutdowns on errors inside a dirty transaction), not specifically to allow memory allocations to fail.

Yes. I agree.

-Saradhi.

Quoted 8 lines

Cheers,

Dave.
--
Dave Chinner
[email protected]

[[HTML alternate version deleted]]

#7 lore raw
In reply to Eric Sandeen
Quoted 11 lines · Eric Sandeen
Quoted 9 lines · Bhagi rathi

Why are we going to block for ever? Mounting a file-system requires in-core log space buffers, reading of other buffers which needs allocation of memory greater than per ag structures.

I am trying to understand why xfs_perag_t? Mount/Unmount are not frequent activities, it is better for them to succeed if operating system can allocate memory and take them forward.

Quoted 5 lines

But that's the big if, right?

If the system is so starved that you can't get this memory to even start the mount process, I'm sure it's better to fail the mount with -ENOMEM than to add to the current system memory stress.

Not really. It is going to fail many automated scripts. We are designing for a problem that system is starved with memory. It points to a bug in memory & system dirty state cleaning, they are the ideal problems to be solved this instead of this. As long as system recovers, it is good not to disturb automated scripts by introducing these kind of unnecessary failures of the mount command.

Quoted 4 lines

In general KM_MAYFAIL sounds like a good plan when you can handle the failure gracefully, I think.

Not really. It fails mount gracefully, however, it needs administrative
action.
It is expected that operating system will recover and functional without admin intervention.

Cheers,
Bhagi.

Quoted 4 lines

-Eric

[[HTML alternate version deleted]]