Skip to content

Commit 46e700a

Browse files
gormanmtorvalds
authored andcommitted
mm, page_alloc: remove unnecessary taking of a seqlock when cpusets are disabled
There is a seqcounter that protects against spurious allocation failures when a task is changing the allowed nodes in a cpuset. There is no need to check the seqcounter until a cpuset exists. Signed-off-by: Mel Gorman <[email protected]> Acked-by: Christoph Lameter <[email protected]> Acked-by: David Rientjes <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: Johannes Weiner <[email protected]> Cc: Vitaly Wool <[email protected]> Cc: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent c9ab0c4 commit 46e700a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

include/linux/cpuset.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ extern void cpuset_print_current_mems_allowed(void);
104104
*/
105105
static inline unsigned int read_mems_allowed_begin(void)
106106
{
107+
if (!cpusets_enabled())
108+
return 0;
109+
107110
return read_seqcount_begin(&current->mems_allowed_seq);
108111
}
109112

@@ -115,6 +118,9 @@ static inline unsigned int read_mems_allowed_begin(void)
115118
*/
116119
static inline bool read_mems_allowed_retry(unsigned int seq)
117120
{
121+
if (!cpusets_enabled())
122+
return false;
123+
118124
return read_seqcount_retry(&current->mems_allowed_seq, seq);
119125
}
120126

0 commit comments

Comments
 (0)