From patchwork Fri Jun 20 16:00:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 362295 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 61251140086 for ; Sat, 21 Jun 2014 02:01:31 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=PqX2f0/0nxl6iGl7EJG3hw5FhdS8F xSCvMhyEQUeB+c71CYwlmAIn9cg9F9U+jTSmC6bK/xssT6ubyv9741s/cKlTBsBr W/FRV6TcVwyIERVoy9cvNdq1PFWBahHV0Hb3HCcwfrYMkqekGuvs5zlCMWf6+AD2 efMOrSrA/3Cm1s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=/Q8FVwpSnD3LnHzamWX60p3En9c=; b=Jj/ bFQiQCVNUYYYnxSXr6ggIw/dlUz4ceOoP+wcPyIuW5qYLAGwIYYsx6yeqNrEPSrd 9aJlyqdGPMtEP1xUuxCU0xznMZRqn6lgrRzxfvsHwqg1mN2uiFUev7SsO1zPl0BD 5Xlc1TQnnTNetmHAXK0gq/AQxWsY3vjf73eixms8= Received: (qmail 15236 invoked by alias); 20 Jun 2014 16:01:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15218 invoked by uid 89); 20 Jun 2014 16:01:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Fri, 20 Jun 2014 16:00:50 +0000 From: "Joseph S. Myers" To: Subject: Remove __ASSUME_COMPLETE_READV_WRITEV Message-ID: MIME-Version: 1.0 This patch removes the __ASSUME_COMPLETE_READV_WRITEV kernel-features.h macro, now that it can be unconditionally assumed to be true. (The relevant kernel feature was added some time between 2.0 and 2.2, and this macro is only used in sysdeps/unix/sysv/linux/.) Tested x86_64 that the disassembly of installed shared libraries is unchanged by this patch. 2014-06-20 Joseph Myers * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_COMPLETE_READV_WRITEV): Remove macro. * sysdeps/unix/sysv/linux/readv.c: Do not include . [!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code. [!UIO_FASTIOV] (UIO_FASTIOV): Remove macro. (__libc_readv) [__ASSUME_COMPLETE_READV_WRITEV]: Make code unconditional. (__libc_readv) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code. * sysdeps/unix/sysv/linux/writev.c: Do not include . [!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code. [!UIO_FASTIOV] (UIO_FASTIOV): Remove macro. (__libc_writev) [__ASSUME_COMPLETE_READV_WRITEV]: Make code unconditional. (__libc_writev) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code. diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 026f89f..acc7ca3 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -94,11 +94,6 @@ # define __ASSUME_SET_ROBUST_LIST 1 #endif -/* Pessimistically assume that 2.6.18 introduced real handling of - large numbers of requests to readv and writev and that we don't - need a fallback. It likely worked for much longer. */ -#define __ASSUME_COMPLETE_READV_WRITEV 1 - /* Support for PI futexes was added in 2.6.18 (but some architectures lack futex_atomic_cmpxchg_inatomic in some configurations). */ #if !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__) diff --git a/sysdeps/unix/sysv/linux/readv.c b/sysdeps/unix/sysv/linux/readv.c index 48eae46..a977d17 100644 --- a/sysdeps/unix/sysv/linux/readv.c +++ b/sysdeps/unix/sysv/linux/readv.c @@ -23,19 +23,8 @@ #include #include -#include - -#ifndef __ASSUME_COMPLETE_READV_WRITEV -static ssize_t __atomic_readv_replacement (int, const struct iovec *, - int) internal_function; -#endif - - -/* Not all versions of the kernel support the large number of records. */ -#ifndef UIO_FASTIOV -# define UIO_FASTIOV 8 /* 8 is a safe number. */ -#endif +/* Consider moving to syscalls.list. */ ssize_t __libc_readv (fd, vector, count) @@ -56,19 +45,7 @@ __libc_readv (fd, vector, count) LIBC_CANCEL_RESET (oldtype); } -#ifdef __ASSUME_COMPLETE_READV_WRITEV return result; -#else - if (result >= 0 || errno != EINVAL || count <= UIO_FASTIOV) - return result; - - return __atomic_readv_replacement (fd, vector, count); -#endif } strong_alias (__libc_readv, __readv) weak_alias (__libc_readv, readv) - -#ifndef __ASSUME_COMPLETE_READV_WRITEV -# define __libc_readv static internal_function __atomic_readv_replacement -# include -#endif diff --git a/sysdeps/unix/sysv/linux/writev.c b/sysdeps/unix/sysv/linux/writev.c index 06c4c9c..f19221f 100644 --- a/sysdeps/unix/sysv/linux/writev.c +++ b/sysdeps/unix/sysv/linux/writev.c @@ -23,19 +23,9 @@ #include #include -#include -#ifndef __ASSUME_COMPLETE_READV_WRITEV -static ssize_t __atomic_writev_replacement (int, const struct iovec *, - int) internal_function; -#endif - - -/* Not all versions of the kernel support the large number of records. */ -#ifndef UIO_FASTIOV -# define UIO_FASTIOV 8 /* 8 is a safe number. */ -#endif +/* Consider moving to syscalls.list. */ ssize_t __libc_writev (fd, vector, count) @@ -56,19 +46,7 @@ __libc_writev (fd, vector, count) LIBC_CANCEL_RESET (oldtype); } -#ifdef __ASSUME_COMPLETE_READV_WRITEV return result; -#else - if (result >= 0 || errno != EINVAL || count <= UIO_FASTIOV) - return result; - - return __atomic_writev_replacement (fd, vector, count); -#endif } strong_alias (__libc_writev, __writev) weak_alias (__libc_writev, writev) - -#ifndef __ASSUME_COMPLETE_READV_WRITEV -# define __libc_writev static internal_function __atomic_writev_replacement -# include -#endif