International Business Machines (IBM -0.15%) reported generally positive second-quarter results. Both revenue and adjusted earnings came in ahead of expectations, with double-digit constant currency sales growth in the software, consulting, and infrastructure segments.

The stock sank on Tuesday, though, as investors digested headwinds related to a strong U.S. dollar. Changes in currency exchange rates will knock off around 6 percentage points of revenue growth for the full year, and the company trimmed its free cash flow outlook a bit to approximately $10 billion.

Many of IBM's products and services performed well during the quarter, but the mainframe business stood out. IBM has been churning out mainframe systems for nearly 60 years, and the latest addition to the lineup drove a nice sales increase that will help the company hits its growth target for the year.

The IBM z16 mainframe.

Image source: IBM.

A mainframe growth boost

IBM rolls out a new iteration of its Z-series mainframe systems every few years, delivering big improvements to performance and security while integrating new features. The company announced the z16 system in April, touting an integrated AI accelerator and other advanced security features.

Mainframes may seem like a thing of the past, but for the most part, IBM's customer base isn't going anywhere. IBM mainframes are in use at 45 of the world's top 50 banks, eight of the top 10 insurers, seven of the top 10 retailers, and eight of the top 10 telecommunication companies.

Each new mainframe launch prompts some of those customers to upgrade, triggering an upgrade cycle and a big sales boost that usually lasts for a few quarters. Each cycle is a little different, depending on the timing, but the z16 is so far following that familiar pattern. Mainframe sales soared 77% in the second quarter, driving overall infrastructure revenue 25% higher.

Sales of mainframe systems aren't a huge part of IBM's business. Total hybrid infrastructure revenue in the second quarter, which includes mainframes and other hardware, was just $2.8 billion, or about 18% of total revenue. But mainframe systems drive sales of other products and services, including transaction processing software, consulting, and financing. IBM doesn't report its results in a way that makes it obvious how much revenue is ultimately associated with mainframe systems, but it's safe to say that mainframes remain a critical part of its business.

A top-performing tech stock

Even after a post-earnings slump, IBM is one of the best-performing big tech stocks so far in 2022. While other tech stocks have tumbled, and the S&P 500 has shed more than 17% of its value, IBM is down around 3% since the start of the year.

Part of the reason for the outperformance is the amount of pessimism baked into the stock price. IBM is valued at just $117 billion, or less than 12 times its free cash flow guidance. The market is pricing in little to no growth, which seems overly pessimistic.

On top of the mainframe, IBM's consulting business is booming. Consulting revenue was up 18% in constant currency in the second quarter, and it received no one-off benefit from sales to the spun-off Kyndryl. IBM's hybrid cloud strategy covers the full spectrum of software, hardware, and expertise, delivering a complete solution to its clients.

Red Hat, another critical piece of IBM's hybrid cloud strategy, grew software sales by 17% in the quarter. Red Hat consulting revenue nearly doubled, driving a portion of the consulting segment's growth. Red Hat's OpenShift and Enterprise Linux offerings are part of the foundation of IBM's hybrid cloud platform, and they integrate with IBM's mainframe systems and other hardware offerings.

IBM's results this year will take a hit from currency, but underneath the noise, the company is performing well. A potential recession could cool demand for IBM's products and services, but the company will remain a key partner for large companies and organizations looking to invest in hybrid cloud computing.