[Devel] [PATCH VZ9 2/2] fs/fuse/kio: remove aligned-inside-packed kludge
    Pavel Tikhomirov 
    ptikhomirov at virtuozzo.com
       
    Thu Oct 23 10:17:22 MSK 2025
    
    
  
and rh9-5.14.0-427.92.1.vz9.88.2
On 10/23/25 15:16, Pavel Tikhomirov wrote:
> Comited to rh10-6.12.0-55.13.1.2.12.vz10
> 
> On 10/20/25 16:36, Alexey Kuznetsov wrote:
>> Old days this ugly trick was copypasted from user space, where
>> it allowed to use SSE on packet data. Note how ugly
>> and counterintuitive it is: we deliberately misalign buffer
>> start to enforce data to be aligned to 16 bytes.
>> This trick has been removed from user space long ago, we optimized
>> the engine to use aligned data.
>>
>> And in kernel it never made a sense. I was just afraid I forgot
>> something and avoided to touch this antique detail.
>>
>> Signed-off-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
>> ---
>>   fs/fuse/kio/pcs/pcs_sock_io.h | 80 ++++++++++++++++++++ 
>> +----------------------
>>   1 file changed, 39 insertions(+), 41 deletions(-)
>>
>> diff --git a/fs/fuse/kio/pcs/pcs_sock_io.h b/fs/fuse/kio/pcs/ 
>> pcs_sock_io.h
>> index b14e992..ab549a1 100644
>> --- a/fs/fuse/kio/pcs/pcs_sock_io.h
>> +++ b/fs/fuse/kio/pcs/pcs_sock_io.h
>> @@ -46,49 +46,46 @@ enum pcs_msg_flag {
>>       PCS_MSG_ABORTED,
>>   };
>> -__pre_packed struct pcs_msg
>> +struct pcs_msg
>>   {
>> -    struct __pre_aligned(16) {
>> -        struct list_head list;
>> -
>> -        pcs_error_t    error;
>> -        abs_time_t    start_time;
>> -
>> -        void        *private;
>> -        void        *private2;    /* Huh? Need to do something else 
>> here. */
>> -        struct pcs_msg    *response;    /* Consider removing. It can 
>> be done passing the second
>> -                         * argument to done();
>> -                         */
>> -        struct pcs_netio *netio;
>> -        struct pcs_rpc    *rpc;
>> -
>> -        int        size;
>> -        int        _iocount;
>> -        unsigned short    timeout;
>> -        unsigned char    kill_slot;
>> -        unsigned char    stage;
>> -        abs_time_t    io_start_time;
>> -
>> -        unsigned long flags;
>> -
>> -        struct hlist_node    kill_link;
>> -
>> -        void        (*get_iter)(struct pcs_msg *, int offset, struct 
>> iov_iter *it,
>> -                        unsigned int direction);
>> -
>> -        void        (*done)(struct pcs_msg *);
>> -        void        (*destructor)(struct pcs_msg *);
>> -        void        *pool;
>> -        struct iovec    _inline_iovec;
>> -        int        accounted;
>> -
>> -        short        _align_offset;
>> -        short        _inline_len;
>> -        struct kvec    _inline_kv;
>> -    } __aligned(16);
>> -    u64        __pad16_8;
>> +    struct list_head list;
>> +
>> +    pcs_error_t    error;
>> +    abs_time_t    start_time;
>> +
>> +    void        *private;
>> +    void        *private2;    /* Huh? Need to do something else here. */
>> +    struct pcs_msg    *response;    /* Consider removing. It can be 
>> done passing the second
>> +                     * argument to done();
>> +                     */
>> +    struct pcs_netio *netio;
>> +    struct pcs_rpc    *rpc;
>> +
>> +    int        size;
>> +    int        _iocount;
>> +    unsigned short    timeout;
>> +    unsigned char    kill_slot;
>> +    unsigned char    stage;
>> +    abs_time_t    io_start_time;
>> +
>> +    unsigned long flags;
>> +
>> +    struct hlist_node    kill_link;
>> +
>> +    void        (*get_iter)(struct pcs_msg *msg, int offset, struct 
>> iov_iter *it,
>> +                    unsigned int direction);
>> +
>> +    void        (*done)(struct pcs_msg *msg);
>> +    void        (*destructor)(struct pcs_msg *msg);
>> +    struct iovec    _inline_iovec;
>> +    int        accounted;
>> +
>> +    short        _align_offset;
>> +    short        _inline_len;
>> +    struct kvec    _inline_kv;
>> +
>>       char        _inline_buffer[0];
>> -} __packed;
>> +};
>>   static inline void * pcs_msg_aligned_data(struct pcs_msg * msg, int 
>> offset)
>>   {
> 
-- 
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.
    
    
More information about the Devel
mailing list