Skip to content

Commit 86b3de6

Browse files
committed
ring-buffer: Remove HAVE_64BIT_ALIGNED_ACCESS
Commit c19fa94 ("Add HAVE_64BIT_ALIGNED_ACCESS") added the config for architectures that required 64bit aligned access for all 64bit words. As the ftrace ring buffer stores data on 4 byte alignment, this config option was used to force it to store data on 8 byte alignment to make sure the data being stored and written directly into the ring buffer was 8 byte aligned as it would cause issues trying to write an 8 byte word on a 4 not 8 byte aligned memory location. But with the removal of the metag architecture, which was the only architecture to use this, there is no architecture supported by Linux that requires 8 byte aligne access for all 8 byte words (4 byte alignment is good enough). Removing this config can simplify the code a bit. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent a124692 commit 86b3de6

2 files changed

Lines changed: 4 additions & 29 deletions

File tree

‎arch/Kconfig‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,6 @@ config UPROBES
128128
managed by the kernel and kept transparent to the probed
129129
application. )
130130

131-
config HAVE_64BIT_ALIGNED_ACCESS
132-
def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
133-
help
134-
Some architectures require 64 bit accesses to be 64 bit
135-
aligned, which also requires structs containing 64 bit values
136-
to be 64 bit aligned too. This includes some 32 bit
137-
architectures which can do 64 bit accesses, as well as 64 bit
138-
architectures without unaligned access.
139-
140-
This symbol should be selected by an architecture if 64 bit
141-
accesses are required to be 64 bit aligned in this way even
142-
though it is not a 64 bit architecture.
143-
144-
See Documentation/unaligned-memory-access.txt for more
145-
information on the topic of unaligned memory accesses.
146-
147131
config HAVE_EFFICIENT_UNALIGNED_ACCESS
148132
bool
149133
help

‎kernel/trace/ring_buffer.c‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,7 @@ int ring_buffer_print_entry_header(struct trace_seq *s)
128128
#define RB_ALIGNMENT 4U
129129
#define RB_MAX_SMALL_DATA (RB_ALIGNMENT * RINGBUF_TYPE_DATA_TYPE_LEN_MAX)
130130
#define RB_EVNT_MIN_SIZE 8U /* two 32bit words */
131-
132-
#ifndef CONFIG_HAVE_64BIT_ALIGNED_ACCESS
133-
# define RB_FORCE_8BYTE_ALIGNMENT 0
134-
# define RB_ARCH_ALIGNMENT RB_ALIGNMENT
135-
#else
136-
# define RB_FORCE_8BYTE_ALIGNMENT 1
137-
# define RB_ARCH_ALIGNMENT 8U
138-
#endif
139-
140-
#define RB_ALIGN_DATA __aligned(RB_ARCH_ALIGNMENT)
131+
#define RB_ALIGN_DATA __aligned(RB_ALIGNMENT)
141132

142133
/* define RINGBUF_TYPE_DATA for 'case RINGBUF_TYPE_DATA:' */
143134
#define RINGBUF_TYPE_DATA 0 ... RINGBUF_TYPE_DATA_TYPE_LEN_MAX
@@ -2373,7 +2364,7 @@ rb_update_event(struct ring_buffer_per_cpu *cpu_buffer,
23732364

23742365
event->time_delta = delta;
23752366
length -= RB_EVNT_HDR_SIZE;
2376-
if (length > RB_MAX_SMALL_DATA || RB_FORCE_8BYTE_ALIGNMENT) {
2367+
if (length > RB_MAX_SMALL_DATA) {
23772368
event->type_len = 0;
23782369
event->array[0] = length;
23792370
} else
@@ -2388,11 +2379,11 @@ static unsigned rb_calculate_event_length(unsigned length)
23882379
if (!length)
23892380
length++;
23902381

2391-
if (length > RB_MAX_SMALL_DATA || RB_FORCE_8BYTE_ALIGNMENT)
2382+
if (length > RB_MAX_SMALL_DATA)
23922383
length += sizeof(event.array[0]);
23932384

23942385
length += RB_EVNT_HDR_SIZE;
2395-
length = ALIGN(length, RB_ARCH_ALIGNMENT);
2386+
length = ALIGN(length, RB_ALIGNMENT);
23962387

23972388
/*
23982389
* In case the time delta is larger than the 27 bits for it

0 commit comments

Comments
 (0)