Skip to contentSkip to conversation

VFS: make file->f_pos access atomic on 32bit arch

PATCH Michael Trimarchi 2 participants 2 messages Sep 16, 2008 VFS

lore
Share & tools
lore
#0 lore raw

Hi,

----- Messaggio originale -----

Quoted 14 lines

Da: Nick Piggin <[email protected]>
A: Michael Trimarchi <[email protected]>
Cc: Hisashi Hifumi <[email protected]>; [email protected]; [email protected]; [email protected]
Inviato: Martedì 16 settembre 2008, 14:54:21
Oggetto: Re: [PATCH] VFS: make file->f_pos access atomic on 32bit arch

Quoted 7 lines · Michael Trimarchi

Hi,

Quoted 4 lines
(quoted diff) +2 -0
+        if (offset != file_pos_read(file))
+            file_pos_write(file, offset);
        retval = offset;
    }
Quoted 8 lines
Quoted 1 line

Is not more efficient here a compare xchg operation?

The compiler should do it if it was.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

i was thinking about introducing a file_pos_update() not implemented using
file_pos_read()/file_pos_write() and taking the seq_lock or disabling preemption only one time

__________________________________________________
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi
http://mail.yahoo.it
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw
Quoted 31 lines · Michael Trimarchi

Hi,

----- Messaggio originale -----

Quoted 16 lines

Da: Nick Piggin <[email protected]>
A: Michael Trimarchi <[email protected]>
Cc: Hisashi Hifumi <[email protected]>; [email protected]; [email protected]; [email protected] Inviato: Martedì 16 settembre 2008, 14:54:21
Oggetto: Re: [PATCH] VFS: make file->f_pos access atomic on 32bit arch

Quoted 7 lines · Michael Trimarchi

Hi,

Quoted 4 lines
(quoted diff) +2 -0
+        if (offset != file_pos_read(file))
+            file_pos_write(file, offset);
        retval = offset;
    }
Quoted 8 lines
Quoted 1 line

Is not more efficient here a compare xchg operation?

The compiler should do it if it was.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Quoted 3 lines

i was thinking about introducing a file_pos_update() not implemented using
file_pos_read()/file_pos_write() and taking the seq_lock or disabling preemption only one time

AFAIK, the only way to do an atomic 64 bit store on 32-bit x86 is "cmpxchg8b" (with lock prefix on SMP). That would be far slower I'm sure.